GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - unassert-js/unassert-cli: CLI for unassert: encourage reliable programming by writing assertions in production code, and compiling them away from release

BranchesTags
Open more actions menu

Latest commit

 

History

47 Commits
47 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
test
test
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

unassert-cli

CLI for unassert. Provides unassert command which compiles assertions away from target file.

unassert

Build Status NPM version Code Style License

RELATED MODULES

  • 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

CHANGELOG

See CHANGELOG

EXAMPLE

For given math.js below,

'use strict';

const assert = require('node:assert/strict');

function add (a, b) {
    console.assert(typeof a === 'number');
    assert(!isNaN(a));
    assert.equal(typeof b, 'number');
    assert.ok(!isNaN(b));
    return a + b;
}

Install unassert 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';
function add(a, b) {
    return a + b;
}

See unassert 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 when their 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

  • Takuto Wada

LICENSE

Licensed under the MIT license.

About

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

Resources

Readme
MIT license
Activity
Custom properties

Stars

12 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.