{"id":18437235,"url":"https://github.com/power-assert-js/grunt-espower","last_synced_at":"2025-08-09T15:06:16.683Z","repository":{"id":10175879,"uuid":"12261195","full_name":"power-assert-js/grunt-espower","owner":"power-assert-js","description":"Grunt task for power-assert","archived":false,"fork":false,"pushed_at":"2016-12-12T02:49:15.000Z","size":109,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-26T16:21:17.361Z","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":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-21T04:29:25.000Z","updated_at":"2016-12-12T02:29:28.000Z","dependencies_parsed_at":"2022-09-05T05:51:44.296Z","dependency_job_id":null,"html_url":"https://github.com/power-assert-js/grunt-espower","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fgrunt-espower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fgrunt-espower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fgrunt-espower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/power-assert-js%2Fgrunt-espower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/power-assert-js","download_url":"https://codeload.github.com/power-assert-js/grunt-espower/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247725965,"owners_count":20985804,"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:11.814Z","updated_at":"2025-04-07T20:34:01.959Z","avatar_url":"https://github.com/power-assert-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"grunt-espower\n================================\n\nA grunt task for power-assert.\n\n[![Build Status][travis-image]][travis-url]\n[![NPM version][npm-image]][npm-url]\n[![Dependency Status][depstat-image]][depstat-url]\n[![License][license-image]][license-url]\n[![Built with Grunt][grunt-image]][grunt-url]\n\n\nDESCRIPTION\n---------------------------------------\n`grunt-espower` is a grunt task to instrument \"Power Assert\" feature into your code.\n\n\nInternally, `grunt-espower` task uses `espower` module that manipulates assertion expression (JavaScript Code) 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. The magic is done by using [Esprima](http://esprima.org/) and [Escodegen](https://github.com/Constellation/escodegen).\n\nSince 0.9.0, grunt-espower supports sourcemaps by default.\n\nPull-requests, issue reports and patches are always welcomed. See [power-assert](https://github.com/power-assert-js/power-assert) project for more documentation.\n\n\n## Getting Started\nThis plugin requires Grunt `\u003e=0.4.2 \u003c2.0.0`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-espower --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-espower');\n```\n\n## The \"espower\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `espower` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  espower: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n})\n```\n\n### Options\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\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](https://github.com/twada/escallmatch). Any arguments enclosed in bracket (for example, `[message]`) means optional parameters. Without bracket means mandatory parameters.\n\n\n### Usage Examples\n\n#### Default Options\n\n```js\ngrunt.initConfig({\n  espower: {\n    test: {\n      files: [\n        {\n          expand: true,        // Enable dynamic expansion.\n          cwd: 'test/',        // Src matches are relative to this path.\n          src: ['**/*.js'],    // Actual pattern(s) to match.\n          dest: 'espowered/',  // Destination path prefix.\n          ext: '.js'           // Dest filepaths will have this extension.\n        }\n      ]\n    },\n  },\n})\n```\n\n#### Custom Options\n\n```js\ngrunt.initConfig({\n  espower: {\n    demo: {\n      options :{\n        patterns: [\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      files: [\n        {\n          expand: true,        // Enable dynamic expansion.\n          cwd: 'demo/',        // Src matches are relative to this path.\n          src: ['**/*.js'],    // Actual pattern(s) to match.\n          dest: 'espowered_demo/',  // Destination path prefix.\n          ext: '.js'           // Dest filepaths will have this extension.\n        }\n      ]\n    },\n  },\n})\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\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 grunt-espower 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\nCHANGELOG\n---------------------------------------\nSee [CHANGELOG](https://github.com/power-assert-js/grunt-espower/blob/master/CHANGELOG.md)\n\n\nAUTHOR\n---------------------------------------\n* [Takuto Wada](https://github.com/twada)\n\n\nCONTRIBUTORS\n---------------------------------------\n* [vvakame](https://github.com/vvakame)\n\n\nLICENSE\n---------------------------------------\nLicensed under the [MIT](https://github.com/power-assert-js/grunt-espower/blob/master/LICENSE-MIT) license.\n\n[npm-url]: https://npmjs.org/package/grunt-espower\n[npm-image]: https://badge.fury.io/js/grunt-espower.svg\n\n[travis-url]: https://travis-ci.org/power-assert-js/grunt-espower\n[travis-image]: https://secure.travis-ci.org/power-assert-js/grunt-espower.svg?branch=master\n\n[depstat-url]: https://gemnasium.com/power-assert-js/grunt-espower\n[depstat-image]: https://gemnasium.com/power-assert-js/grunt-espower.svg\n\n[license-url]: https://github.com/power-assert-js/grunt-espower/blob/master/LICENSE-MIT\n[license-image]: https://img.shields.io/badge/license-MIT-brightgreen.svg\n\n[grunt-url]: http://gruntjs.com/\n[grunt-image]: https://cdn.gruntjs.com/builtwith.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpower-assert-js%2Fgrunt-espower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpower-assert-js%2Fgrunt-espower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpower-assert-js%2Fgrunt-espower/lists"}