{"id":18437241,"url":"https://github.com/power-assert-js/espowerify","last_synced_at":"2025-10-07T04:44:53.154Z","repository":{"id":15529072,"uuid":"18263634","full_name":"power-assert-js/espowerify","owner":"power-assert-js","description":"Browserify transform for power-assert","archived":false,"fork":false,"pushed_at":"2016-11-13T03:40:36.000Z","size":71,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-23T00:24:30.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/power-assert-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-30T12:32:14.000Z","updated_at":"2021-08-29T07:45:13.000Z","dependencies_parsed_at":"2022-09-14T22:05:59.524Z","dependency_job_id":null,"html_url":"https://github.com/power-assert-js/espowerify","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fespowerify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fespowerify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fespowerify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fespowerify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/power-assert-js","download_url":"https://codeload.github.com/power-assert-js/espowerify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247725977,"owners_count":20985806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T06:14:12.033Z","updated_at":"2025-10-07T04:44:48.130Z","avatar_url":"https://github.com/power-assert-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"espowerify\n================================\n\n[![Build Status][travis-image]][travis-url]\n[![NPM package][npm-image]][npm-url]\n[![Dependency Status][depstat-image]][depstat-url]\n[![License][license-image]][license-url]\n\nBrowserify transform for power-assert.\n\n\nDESCRIPTION\n---------------------------------------\n`espowerify` is a [browserify](http://browserify.org/) transform for [power-assert](http://github.com/power-assert-js/power-assert).\n\n`espowerify` applies [espower](http://github.com/power-assert-js/espower) to target sources through browserify transform chain. `espower` manipulates assertion expression (JavaScript Code) represented as AST defined in [The ESTree Spec](https://github.com/estree/estree) (formerly known as [Mozilla SpiderMonkey Parser API](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API)), to instrument power-assert feature into the code.\n\nPull-requests, issue reports and patches are always welcomed.\n\nSee [power-assert](http://github.com/power-assert-js/power-assert) project for more documentation.\n\n\nFAQ\n---------------------------------------\n\n#### espowerify does not work with babelify!!\n\nespowerify does not work with [babelify](https://github.com/babel/babelify) due to the change of transpiled code since babel 5.0. Please use [babel-plugin-espower with babelify](https://github.com/power-assert-js/babel-plugin-espower#with-babelify).\n\n\nCHANGELOG\n---------------------------------------\nSee [CHANGELOG](https://github.com/power-assert-js/espowerify/blob/master/CHANGELOG.md)\n\n\nHOW TO USE\n---------------------------------------\nFirst, install `power-assert` and `espowerify` via npm.\n\n    $ npm install --save-dev power-assert espowerify\n\nSecond, require `power-assert` in your test.\n\n    --- a/test/your_test.js\n    +++ b/test/your_test.js\n    @@ -1,4 +1,4 @@\n    -var assert = require('assert');\n    +var assert = require('power-assert');\n\nThird, apply `espowerify` through browserify transform.\n\nby command-line,\n\n    $ browserify -t espowerify test/your_test.js \u003e dist/your_test.js\n\nor programmatically,\n\n```javascript\nvar source = require('vinyl-source-stream');\nvar browserify = require('browserify');\nvar glob = require('glob');\n\ngulp.task('build_test', function() {\n    var files = glob.sync('./test/*_test.js');\n    var b = browserify({entries: files, debug: true});\n    b.transform('espowerify');\n    return b.bundle()\n        .pipe(source('all_test.js'))\n        .pipe(gulp.dest('./build'));\n});\n```\n(Note that files are transformed if matches to `entries`)\n\nLastly, run your test in your way. For example,\n\n    $ mocha-phantomjs path/to/test.html\n\n\nSOURCE MAPS\n---------------------------------------\n\nespowerify supports source maps. espowerify generates source maps with all original sources inlined then adds the resulting source map base64 encoded to the bottom of the transformed code.\n\nThis allows debugging the original code when using the debug flag `-d` with browserify.\n\n    $ browserify -d -t espowerify test/your_test.js \u003e dist/your_test_with_sourcemaps.js\n\nor programmatically (see `debug: true` option),\n\n```javascript\nvar source = require('vinyl-source-stream');\nvar browserify = require('browserify');\nvar glob = require('glob');\nvar mold = require('mold-source-map');\n\ngulp.task('build_test', function() {\n    var files = glob.sync('./test/*_test.js');\n    var b = browserify({entries: files, debug: true});\n    b.transform('espowerify');\n    return b.bundle()\n        .pipe(mold.transformSourcesRelativeTo(__dirname))\n        .pipe(source('all_test.js'))\n        .pipe(gulp.dest('./build'));\n});\n```\n(note: `mold-source-map` module adjusts absolute paths in resulting sourcemaps to relative path. This is required if you are debugging with Firefox)\n\nIf the debug flag is not set, these source maps will be removed by browserify and thus will not be contained inside your bundle.\n\n\nAPI\n---------------------------------------\n\n### espowerify(filepath, options)\nApply espower through the browserify transform chain.\n\n#### options.patterns\n\n| type                | default value       |\n|:--------------------|:--------------------|\n| `Array` of `string` | objects shown below |\n\n```javascript\n[\n    'assert(value, [message])',\n    'assert.ok(value, [message])',\n    'assert.equal(actual, expected, [message])',\n    'assert.notEqual(actual, expected, [message])',\n    'assert.strictEqual(actual, expected, [message])',\n    'assert.notStrictEqual(actual, expected, [message])',\n    'assert.deepEqual(actual, expected, [message])',\n    'assert.notDeepEqual(actual, expected, [message])',\n    'assert.deepStrictEqual(actual, expected, [message])',\n    'assert.notDeepStrictEqual(actual, expected, [message])'\n]\n```\n\nTarget patterns for power assert feature instrumentation.\n(This option could be passed by programmatical way only)\n\nIf callee name (for example, `assert.equal`) matches exactly and number of arguments is satisfied, then the assertion will be modified.\nDetection is done by [escallmatch](http://github.com/twada/escallmatch). Any arguments enclosed in bracket (for example, `[message]`) means optional parameters. Without bracket means mandatory parameters.\n\n\nOUR SUPPORT POLICY\n---------------------------------------\n\nWe support Node under maintenance. In other words, we stop supporting old Node version when [their maintenance ends](https://github.com/nodejs/LTS).\n\nThis means that any other environment is not supported.\n\nNOTE: If espowerify works in any of the unsupported environments, it is purely coincidental and has no bearing on future compatibility. Use at your own risk.\n\n\nAUTHOR\n---------------------------------------\n* [Takuto Wada](http://github.com/twada)\n\n\nCONTRIBUTORS\n---------------------------------------\n* [azu](https://github.com/azu)\n\n\nLICENSE\n---------------------------------------\nLicensed under the [MIT](https://github.com/power-assert-js/espowerify/blob/master/MIT-LICENSE.txt) license.\n\n\n[npm-url]: https://npmjs.org/package/espowerify\n[npm-image]: https://badge.fury.io/js/espowerify.svg\n\n[travis-url]: http://travis-ci.org/power-assert-js/espowerify\n[travis-image]: https://secure.travis-ci.org/power-assert-js/espowerify.svg?branch=master\n\n[depstat-url]: https://gemnasium.com/power-assert-js/espowerify\n[depstat-image]: https://gemnasium.com/power-assert-js/espowerify.svg\n\n[license-url]: https://github.com/power-assert-js/espowerify/blob/master/MIT-LICENSE.txt\n[license-image]: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpower-assert-js%2Fespowerify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpower-assert-js%2Fespowerify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpower-assert-js%2Fespowerify/lists"}