Browse Source

actually use options

dev/fix.absolute.path
Brett Langdon 12 years ago
parent
commit
b95c058b0c
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      lib/index.js

+ 8
- 1
lib/index.js View File

@ -1,4 +1,5 @@
var http = require('http');
var querystring = require('querystring');
module.exports.nicify = function(js, options, callback) {
if (typeof options === 'function') {
@ -7,10 +8,16 @@ module.exports.nicify = function(js, options, callback) {
}
options = options || {};
var query = {
pretty: (options.pretty === undefined)? 1 : (options.pretty)? 1 : 0,
rename: (options.rename === undefined)? 1 : (options.rename)? 1 : 0,
types: (options.types === undefined)? 1 : (options.types)? 1 : 0,
suggest: (options.suggest === undefined)? 1 : (options.suggest)? 1 : 0,
};
var reqOptions = {
hostname: 'www.jsnice.org',
path: '/beautify?pretty=1&rename=1&types=1&suggest=0',
path: '/beautify?' + querystring.stringify(query),
port: 80,
method: 'POST',
};


Loading…
Cancel
Save