{"id":18458731,"url":"https://github.com/browserify/commonjs-assert","last_synced_at":"2025-05-14T01:02:09.091Z","repository":{"id":11991305,"uuid":"14567595","full_name":"browserify/commonjs-assert","owner":"browserify","description":"Node.js's require('assert') for all engines","archived":false,"fork":false,"pushed_at":"2024-12-21T09:36:17.000Z","size":225,"stargazers_count":301,"open_issues_count":5,"forks_count":61,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-27T11:02:31.982Z","etag":null,"topics":["assert","browserify","javascript","node-shim","nodejs"],"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/browserify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/assert","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2013-11-20T20:04:10.000Z","updated_at":"2025-02-16T03:12:06.000Z","dependencies_parsed_at":"2024-06-18T12:02:52.701Z","dependency_job_id":"1404a14e-3f18-4cb6-b010-2a2e547f95e9","html_url":"https://github.com/browserify/commonjs-assert","commit_stats":{"total_commits":191,"total_committers":15,"mean_commits":"12.733333333333333","dds":0.2984293193717278,"last_synced_commit":"c628adcf35900c423ae2c14914eab133cfe9f2ad"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fcommonjs-assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fcommonjs-assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fcommonjs-assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fcommonjs-assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/commonjs-assert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251904151,"owners_count":21662725,"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":["assert","browserify","javascript","node-shim","nodejs"],"created_at":"2024-11-06T08:19:50.157Z","updated_at":"2025-05-14T01:02:08.644Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","readme":"# assert\n\n\u003e The [`assert`](https://nodejs.org/api/assert.html) module from Node.js, for the browser.\n\n[![Build Status](https://travis-ci.org/browserify/commonjs-assert.svg?branch=master)](https://travis-ci.org/browserify/commonjs-assert)\n[![npm](https://img.shields.io/npm/dm/assert.svg)](https://www.npmjs.com/package/assert)\n[![npm](https://img.shields.io/npm/v/assert.svg)](https://www.npmjs.com/package/assert)\n\nWith browserify, simply `require('assert')` or use the `assert` global and you will get this module.\n\nThe goal is to provide an API that is as functionally identical to the [Node.js `assert` API](https://nodejs.org/api/assert.html) as possible. Read the [official docs](https://nodejs.org/api/assert.html) for API documentation.\n\n## Install\n\nTo use this module directly (without browserify), install it as a dependency:\n\n```\nnpm install assert\n```\n\n## Inconsistencies with Node.js `assert`\n\nDue to differences between browsers, some error properties such as `message` and `stack` will be inconsistent. However the assertion behaviour is as close as possible to Node.js and the same error `code` will always be used.\n\n## Usage with bundlers that don't automatically include polyfills for Node.js APIs\n\nBundlers like `webpack 5` and `Vite.js` (and possibly others) don't automatically include polyfills for Node.js APIs. Like most packages on npm, this module depends on other Node.js APIs, so it won't work with these bundlers without also including a polyfill for the `process` Node.js global. You can use [this library](https://github.com/defunctzombie/node-process) to polyfill the `process` global.\n\nNote that this is not a flaw in this package - this package will work without any manual configuration with `browserify` and `webpack 4` and other working bundlers. Unfortunately, some bundlers decided to require an explicit allow-list of all Node.js API specific packages instead of having them work out of the box, hence the incompatibility. See https://github.com/browserify/commonjs-assert/issues/55 for some more context.\n\n## Contributing\n\nTo contribute, work on the source files. Then build and run the tests against the built files. Be careful to not introduce syntax that will be transpiled down to unsupported syntax. For example, `for...of` loops will be transpiled to use `Symbol.iterator` which is unavailable in IE.\n\n### Build scripts\n\n#### `npm run build`\n\nBuilds the project into the `build` dir.\n\n#### `npm run dev`\n\nWatches source files for changes and rebuilds them into the `build` dir.\n\n#### `npm run test`\n\nBuilds the source files into the `build` dir and then runs the tests against the built project.\n\n#### `npm run test:nobuild`\n\nRuns the tests against the built project without rebuilding first.\n\nThis is useful if you're debugging in the transpiled code and want to re-run the tests without overwriting any changes you may have made.\n\n#### `npm run test:source`\n\nRuns the tests against the unbuilt source files.\n\nThis will only work on modern Node.js versions.\n\n#### `npm run test:browsers`\n\nRun browser tests against the all targets in the cloud.\n\nRequires airtap credentials to be configured on your machine.\n\n#### `npm run test:browsers:local`\n\nRun a local browser test server. No airtap configuration required.\n\nWhen paired with `npm run dev` any changes you make to the source files will be automatically transpiled and served on the next request to the test server.\n\n## License\n\nMIT © Joyent, Inc. and other Node contributors\n","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/assert"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fcommonjs-assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Fcommonjs-assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fcommonjs-assert/lists"}