Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "optimal", | ||
"version": "0.1.0", | ||
"description": "Kickass JS arguments parser", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"devDependencies": { | ||
"mocha": ">= 0.0.0", | ||
"should": ">= 0.0.0" | ||
}, | ||
"version": "0.2.0", | ||
"description": "Options object builder and validator.", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"test": "mocha -R spec -r should test/optimal.js" | ||
"babel": "build-lib ./src -d ./lib", | ||
"coverage": "run-coverage", | ||
"eslint": "run-linter ./bin ./src ./tests", | ||
"flow": "type-check", | ||
"jest": "run-tests", | ||
"posttest": "yarn run flow", | ||
"pretest": "yarn run eslint", | ||
"preversion": "yarn test && yarn run babel", | ||
"test": "yarn run jest" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/Numbee/Optimal.git" | ||
"url": "git+https://github.com/milesj/optimal.git" | ||
}, | ||
"author": "stoke <stoke@autistici.org>", | ||
"license": "MIT" | ||
"keywords": [ | ||
"opts", | ||
"options", | ||
"builder", | ||
"validator", | ||
"config", | ||
"defaults", | ||
"object", | ||
"params" | ||
], | ||
"author": { | ||
"name": "Miles Johnson", | ||
"url": "http://milesj.me" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/milesj/optimal/issues" | ||
}, | ||
"homepage": "https://github.com/milesj/optimal#readme", | ||
"dependencies": { | ||
"babel-runtime": "^6.23.0" | ||
}, | ||
"devDependencies": { | ||
"@milesj/build-tool-config": "^0.11.1" | ||
}, | ||
"babel": { | ||
"extends": "./node_modules/@milesj/build-tool-config/babel.json5" | ||
}, | ||
"eslintConfig": { | ||
"extends": "./node_modules/@milesj/build-tool-config/eslint.json5" | ||
}, | ||
"jest": { | ||
"preset": "@milesj/build-tool-config" | ||
} | ||
} |
@@ -1,12 +0,38 @@ | ||
Optimal | ||
======= | ||
# Optimal [DEV] | ||
![travis](https://secure.travis-ci.org/Numbee/Optimal.png?branch=master) | ||
Options object builder and validator. | ||
### Documentation | ||
## Usage | ||
Check ```example/``` | ||
Pass a plain object and a factory function to `Options`. The factory defines a | ||
blueprint for every property, and its value, within the options object. | ||
### Install | ||
The plain object is then validated, built, and returned. | ||
`npm install optimal` | ||
```js | ||
const baseOptions = { | ||
bool: false, | ||
number: 10, | ||
}; | ||
const options = new Options(baseOptions, ({ bool, string, number, func }) => ({ | ||
bool: bool(true), | ||
string: string('foo').notEmpty(), | ||
number: number(5).between(0, 10), | ||
func: func(), | ||
})); | ||
/* | ||
{ | ||
bool: true, | ||
string: 'foo', | ||
number: 10, | ||
func: null, | ||
} | ||
*/ | ||
const { | ||
string, // foo | ||
number, // 10 | ||
} = options; | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
171461
1
20
389
0
1
39
1
2
2
+ Addedbabel-runtime@^6.23.0
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)