{"library":"power-assert","title":"power-assert","description":"Power Assert in JavaScript v1.6.1 (stable, released 2017). Provides descriptive assertion messages via the standard Node.js assert interface. No API is the best API – you only need assert(any_expression). Requires code transformation (via Babel, browserify, webpack, etc.) to generate detailed failure messages. Differentiated from chai/should by reusing the native assert module; you can swap require('power-assert') for require('assert') with zero API change. Works server-side and browser-side. Maintained by the original author but has been stable with infrequent releases.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install power-assert"],"cli":null},"imports":["import 'power-assert'; const assert = require('assert');","const assert = require('power-assert');","import assert from 'power-assert';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install: npm install --save-dev power-assert babel-plugin-espower\n// .babelrc: { \"plugins\": [\"babel-plugin-espower\"] }\n// test.js\nimport 'power-assert';\nconst assert = require('assert');\n\nconst a = [1, 2, 3];\nconst b = [1, 2, 3, 4];\nassert.deepStrictEqual(a, b);\n\n// Without transformation: AssertionError [ERR_ASSERTION]: [1,2,3] deepStrictEqual [1,2,3,4]\n// With power-assert transformation:\n//   assert.deepStrictEqual(a, b)\n//                         |  |\n//                         |  [1,2,3,4]\n//                         [1,2,3]","lang":"javascript","description":"Usage with Babel: augment assert, then use native assert methods; power-assert provides detailed diffs.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}