Socket
Socket
Sign inDemoInstall

nomnom

Package Overview
Dependencies
2
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.2 to 1.7.0

test.js

4

nomnom.js

@@ -463,2 +463,6 @@ var _ = require("underscore"),

if (option.transform) {
value = option.transform(value);
}
var name = option.name || arg;

@@ -465,0 +469,0 @@ if (option.choices && option.choices.indexOf(value) == -1) {

2

package.json
{
"name": "nomnom",
"description": "Option parser with generated usage and commands",
"version": "1.6.2",
"version": "1.7.0",
"author": "Heather Arthur <fayearthur@gmail.com>",

@@ -6,0 +6,0 @@ "scripts": {

@@ -176,2 +176,6 @@ # nomnom

#### type
If you don't want the option JSON-parsed, specify type `"string"`.
#### callback

@@ -184,4 +188,5 @@

callback: function(count) {
if (count != parseInt(count))
if (count != parseInt(count)) {
return "count must be an integer";
}
}

@@ -211,6 +216,15 @@ })

#### type
#### transform
If you don't want the option JSON-parsed, specify type `"string"`.
A function that takes the value of the option as entered and returns a new value that will be seen as the value of the option.
```javascript
nomnom.option('date', {
abbr: 'd',
transform: function(timestamp) {
return new Date(timestamp);
}
})
```
#### hidden

@@ -217,0 +231,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc