Browse Source

update according to jsnice website

pull/10/head
Donaldtone 7 years ago
parent
commit
767839a929
4 changed files with 11 additions and 3 deletions
  1. +3
    -1
      README.md
  2. +5
    -1
      bin/jsnice
  3. +2
    -0
      lib/index.js
  4. +1
    -1
      package.json

+ 3
- 1
README.md View File

@ -14,13 +14,15 @@ npm install -g jsnice
$ jsnice --help
Usage:
jsnice <file>
jsnice [--no-pretty] [--no-rename] [--no-types] [--suggest] <file>
jsnice [--no-pretty] [--no-transpile] [--no-packers] [--no-rename] [--no-types] [--suggest] <file>
jsnice (--help | --version)
Options:
--help Show this text
--version Show jsnice version info
--no-pretty Dont prettify the script
--no-transpile Dont transpile to ES5
--no-packers Dont detect packers
--no-rename Dont rename variables
--no-types Dont add doc strings for params/returns
--suggest Suggest new local names e.g. local$$2


+ 5
- 1
bin/jsnice View File

@ -8,13 +8,15 @@ var jsnice = require('../');
var doc = [
'Usage:',
' jsnice <file>',
' jsnice [--no-pretty] [--no-rename] [--no-types] [--suggest] <file>',
' jsnice [--no-pretty] [--no-packers] [--no-transpile] [--no-rename] [--no-types] [--suggest] <file>',
' jsnice (--help | --version)',
'',
'Options:',
' --help Show this text',
' --version Show jsnice version info',
' --no-pretty Dont prettify the script',
' --no-packers Dont detect packers',
' --no-transpile Dont transpile to ES5',
' --no-rename Dont rename variables',
' --no-types Dont add doc strings for params/returns',
' --suggest Suggest new local names e.g. local$$2',
@ -30,6 +32,8 @@ var filePath = args['<file>'];
var js = fs.readFileSync(filePath);
var options = {
pretty: !args['--no-pretty'],
packers: !args['--no-packers'],
transpile: !args['--no-transpile'],
types: !args['--no-types'],
rename: !args['--no-rename'],
suggest: args['--suggest'],


+ 2
- 0
lib/index.js View File

@ -10,6 +10,8 @@ module.exports.nicify = function(js, options, callback) {
options = options || {};
var query = {
pretty: (options.pretty === undefined)? 1 : (options.pretty)? 1 : 0,
packers: (options.packers === undefined)? 1 : (options.packers)? 1 : 0,
transpile: (options.transpile === undefined)? 1 : (options.transpile)? 1 : 0,
rename: (options.rename === undefined)? 1 : (options.rename)? 1 : 0,
types: (options.types === undefined)? 1 : (options.types)? 1 : 0,
suggest: (options.suggest === undefined)? 0 : (options.suggest)? 1 : 0,


+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{
"name": "jsnice",
"version": "0.2.0",
"version": "0.3.0",
"description": "Run JSNice on your javascripts",
"main": "lib/index.js",
"scripts": {


Loading…
Cancel
Save