Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion bin/jsnice
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'],
Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down