Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CLI for unassert: encourage reliable programming by writing assertions in production code, and compiling them away from release

License

NotificationsYou must be signed in to change notification settings

unassert-js/unassert-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI forunassert. Providesunassert command which compiles assertions away from target file.

unassert

Build StatusNPM versionCode StyleLicense

RELATED MODULES

CHANGELOG

SeeCHANGELOG

EXAMPLE

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

via npm

Install globally,

$ npm install -g unassert-cli

and/or locally.

$ npm install --save-dev unassert-cli

USAGE

$ unassert /path/to/src/target.js > /path/to/build/target.js
$ cat /path/to/src/target.js | unassert > /path/to/build/target.js

OUR SUPPORT POLICY

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.

AUTHOR

LICENSE

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

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp