- Notifications
You must be signed in to change notification settings - Fork0
CLI for unassert: encourage reliable programming by writing assertions in production code, and compiling them away from release
License
unassert-js/unassert-cli
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
CLI forunassert. Providesunassert
command which compiles assertions away from target file.
- unassert: Encourages programming with assertions by providing tools to compile them away.
- unassertify: Browserify transform for unassert
- babel-plugin-unassert: Babel plugin for unassert
- webpack-unassert-loader: Webpack loader for unassert
- gulp-unassert: Gulp plugin for unassert
- rollup-plugin-unassert: RollupJS plugin for unassert
SeeCHANGELOG
For givenmath.js
below,
'use strict';constassert=require('node:assert/strict');functionadd(a,b){console.assert(typeofa==='number');assert(!isNaN(a));assert.equal(typeofb,'number');assert.ok(!isNaN(b));returna+b;}
Installunassert
command, run it and redirect its output into file.
$ npm install -g unassert-cli$ unassert /path/to/src/math.js > /path/to/dist/math.js
Then you will see assert calls in/path/to/dist/math.js
disappear.
'use strict';functionadd(a,b){returna+b;}
Seeunassert project for more documentation.
Install globally,
$ npm install -g unassert-cli
and/or locally.
$ npm install --save-dev unassert-cli
$ unassert /path/to/src/target.js > /path/to/build/target.js
$ cat /path/to/src/target.js | unassert > /path/to/build/target.js
We support Node under maintenance. In other words, we stop supporting old Node version whentheir maintenance ends.
This means that any other environment is not supported.
NOTE: If unassert-cli works in any of the unsupported environments, it is purely coincidental and has no bearing on future compatibility. Use at your own risk.
Licensed under theMIT license.
About
CLI for unassert: encourage reliable programming by writing assertions in production code, and compiling them away from release
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.