babel-plugin-espower weekly downloads statistics
By power-assert-js · npm · Babel plugins
Babel plugin for power-assert
babel-plugin-espower has 59,595 recorded weekly downloads on npm, a decrease of 47.8% over the past 30 days, ranking #559 of 2,322 tracked listings.
About babel-plugin-espower
babel-plugin-espower
Babel plugin for power-assert.
[![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![Dependency Status][depstat-image]][depstat-url] [![License][license-image]][license-url]
DESCRIPTION
babel-plugin-espower is a Babel plugin for power-assert.
power-assert provides descriptive assertion messages for your tests, like this.
1) ES6 demo Destructuring and TemplateLiteral:
AssertionError: # test/demo_test.js:7
assert(`${ alice.name } and ${ bob.name }` === `bob and alice`)
| | | | | | |
| | | | | | "bob and alice"
| | | | "bob" false
| | "alice" Object{name:"bob"}
| Object{name:"alice"}
"alice and bob"
--- [string] `bob and alice`
+++ [string] `${ alice.name } and ${ bob.name }`
@@ -1,13 +1,13 @@
-bob and alice
+alice and bob
Pull-requests, issue reports and patches are always welcomed. See power-assert project for more documentation.
FYI: There's a babel preset for all power-assert plugins
INSTALL
$ npm install --save-dev babel-plugin-espower
CAUTION
Babel7 is incompatible with Babel6. Babel6 is incompatible with Babel5.
For Babel6, you need to use the 2.x release of babel-plugin-espower.
$ npm install --save-dev babel-plugin-espower@2
For Babel5 or lower, you need to use the 1.x release of babel-plugin-espower.
$ npm install --save-dev babel-plugin-espower@1
HOW TO USE
via .babelrc
{
"presets": [
...
],
"plugins": [
"babel-plugin-espower"
]
}
$ babel /path/to/test/some_test.js > /path/to/build/some_test.js
For example, with @babel/register module and .babelrc above, you can run mocha without code generation steps.
$ $(npm bin)/mocha --require @babel/register test/some_test.js
via Babel API
var babel = require('@babel/core');
var jsCode = fs.readFileSync('/path/to/test/some_test.js');
var transformed = babel.transform(jsCode, {
presets: [...],
plugins: ['babel-plugin-espower']
});
console.log(transformed.code);
via Babel Require Hook
require('@babel/register')({
presets: [...],
plugins: ['babel-plugin-espower']
});
For example, with babel_hook.js above, you can run mocha without code generation steps.
$ $(npm bin)/mocha --require ./babel_hook /path/to/test/demo_test.js
with babelify
var fs = require('fs');
var browserify = require('browserify');
var babelify = require('babelify');
var glob = require('glob'),
browserify({ entries: glob.sync('./test/*_test.js'), debug: true })
.transform(babelify.configure({
presets: [...],
plugins: ['babel-plugin-espower']
}))
.bundle()
.on('error', function (err) { console.log('Error : ' + err.message); })
.pipe(fs.createWriteStream('all_test.js'));
$ $(npm bin)/browserify -d -e ./test/*_test.js -t [ babelify --presets ... --plugins babel-plugin-espower ]
with babelify and gulp
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var glob = require('glob'),
gulp.task('build_test', function() {
var files = glob.sync('./test/*_test.js');
var b = browserify({entries: files, debug: true});
b.transform(babelify.configure({
presets: [...],
plugins: ['babel-plugin-espower']
}));
return b.bundle()
.pipe(source('all_test.js'))
.pipe(gulp.dest('./build'));
});
with babelify and Karma
module.exports = function(config) {
config.set({
frameworks: ['mocha', 'browserify'],
files: [
"test/**/*.js"
],
preprocessors: {
"test/**/*.js": "browserify"
},
browserify: {
debug: true,
transform: [
[
'babelify', {
presets: [...],
plugins: ['babel-plugin-espower']
}
]
]
},
// ...
EXAMPLE
For given test file test/demo_test.js below,
import assert from 'power-assert';
describe('ES6 demo', () => {
it('Destructuring and TemplateLiteral', () => {
let [alice, bob] = [ { name: 'alice' }, { name: 'bob' } ];
assert(`${alice.name} and ${bob.name}` === `bob and alice`);
});
it('ArrowFunctionExpression and SpreadElement', () => {
let seven = 7, ary = [4, 5];
assert(seven === ((v, i) => v + i)(...[...ary]));
});
it('Enhanced Object Literals', () => {
let name = 'bobby';
assert.deepEqual({
name,
[ `${name}'s greet` ]: `Hello, I'm ${name}`
}, null);
});
});
prepare babel_hook.js to transform tests.
{
"presets": [
...
],
"plugins": [
"babel-plugin-espower"
]
}
Run mocha with --require @babel/register option. You will see the power-assert output appears.
$ $(npm bin)/mocha --require @babel/register test/demo_test.js…
Description from the npm listing.
- assert
- assertion
- babel
- babel-plugin
- power-assert
- test
- testing
- transform
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Babel plugins plugins
All 20 babel-plugin-espower alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/babel-plugin-espower. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.