{"id":18687290,"url":"https://github.com/junosuarez/node-npm-idempotent-rebuild","last_synced_at":"2025-11-08T02:30:30.808Z","repository":{"id":65464952,"uuid":"52952315","full_name":"junosuarez/node-npm-idempotent-rebuild","owner":"junosuarez","description":"node module: run npm rebuild only if cannot load native modules","archived":false,"fork":false,"pushed_at":"2016-05-28T06:01:54.000Z","size":205,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-15T16:46:20.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junosuarez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-02T09:54:21.000Z","updated_at":"2017-02-03T09:29:36.000Z","dependencies_parsed_at":"2023-01-24T17:25:18.155Z","dependency_job_id":null,"html_url":"https://github.com/junosuarez/node-npm-idempotent-rebuild","commit_stats":null,"previous_names":["jden/node-npm-idempotent-rebuild"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fnode-npm-idempotent-rebuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fnode-npm-idempotent-rebuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fnode-npm-idempotent-rebuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fnode-npm-idempotent-rebuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junosuarez","download_url":"https://codeload.github.com/junosuarez/node-npm-idempotent-rebuild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239231083,"owners_count":19603990,"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-07T10:32:20.339Z","updated_at":"2025-11-08T02:30:30.770Z","avatar_url":"https://github.com/junosuarez.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-idempotent-rebuild\nrun npm rebuild only if cannot load native modules\n\n[![npm](https://img.shields.io/npm/v/npm-idempotent-rebuild.svg)][npm]\n[![js standard style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)][standard]\n[![Dependency Status](https://david-dm.org/jden/node-npm-idempotent-rebuild.svg)][dependencies]\n[![build status](https://circleci.com/gh/jden/node-npm-idempotent-rebuild.svg?\u0026style=shield)][circleci]\n\n[npm]: https://www.npmjs.com/package/npm-idempotent-rebuild\n[standard]: http://standardjs.com/\n[dependencies]: https://david-dm.org/jden/node-npm-idempotent-rebuild\n[circleci]: https://circleci.com/gh/jden/node-npm-idempotent-rebuild\n\nRebuilding native modules can be slow. This module attempts loading all native modules in\nthe dependency tree. If they fail, it runs `npm rebuild`. This is useful when switching\nbetween node versions or between operating systems with cached `node_modules` directories.\n\n\n## cli usage\n```\n$ npm-idempotent-rebuild\n```\n\n## programmatic usage\n```js\nconst npmIdempotentRebuild = require('npm-idempotent-rebuild')\nnpmIdempotentRebuild({dir: __dirname}, function (err, rebuilt) {\n  console.log(err, rebuilt ? : 'rebuilt node modules' : 'skipped rebuilding')\n})\n```\n\n\n## api\nwith [jsig](https://github.com/jsigbiz/spec) type annotation:\n\n### `npmIdempotentRebuild(opt, callback : Callback\u003crebuilt: Boolean\u003e) =\u003e void`\nRebuilds node_modules if necessary. Takes a Node.js-style callback with error, if any,\nand `rebuilt`, which is true if `npm rebuild` was executed.\n\nOptions:\n- `level`: String - one of `silent` (default), `info`, or `debug`\n- `dir`: String - the cwd for running `npm rebuild`, defaults to current cwd.\n\n\n## installation\n\n    $ npm install npm-idempotent-rebuild\n\n\n## running the tests\n\nFrom package root:\n\n    $ npm install\n    $ npm test\n\nFor debug information, set env var DEBUG=true\n\n\n## contributors\n\n- jden \u003cjason@denizac.org\u003e\n\n\n## license\n\nISC. (c) MMXVI jden \u003cjason@denizac.org\u003e. See LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunosuarez%2Fnode-npm-idempotent-rebuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunosuarez%2Fnode-npm-idempotent-rebuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunosuarez%2Fnode-npm-idempotent-rebuild/lists"}