{"id":17944802,"url":"https://github.com/smt116/node-native-ext-loader","last_synced_at":"2025-08-09T14:20:59.645Z","repository":{"id":25699796,"uuid":"105668418","full_name":"smt116/node-native-ext-loader","owner":"smt116","description":"Loader for Node native extensions","archived":false,"fork":false,"pushed_at":"2021-12-17T05:11:02.000Z","size":35,"stargazers_count":60,"open_issues_count":1,"forks_count":25,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-14T11:17:11.416Z","etag":null,"topics":["electron","javascript","loader","native","node","nodejs","npm-package","webpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/native-ext-loader","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/smt116.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-03T15:27:39.000Z","updated_at":"2023-08-15T16:14:35.000Z","dependencies_parsed_at":"2022-07-15T14:47:12.091Z","dependency_job_id":null,"html_url":"https://github.com/smt116/node-native-ext-loader","commit_stats":null,"previous_names":["smt116/node-native-loader"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smt116%2Fnode-native-ext-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smt116%2Fnode-native-ext-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smt116%2Fnode-native-ext-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smt116%2Fnode-native-ext-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smt116","download_url":"https://codeload.github.com/smt116/node-native-ext-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221997290,"owners_count":16913723,"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":["electron","javascript","loader","native","node","nodejs","npm-package","webpack"],"created_at":"2024-10-29T06:05:09.348Z","updated_at":"2024-10-29T06:05:09.981Z","avatar_url":"https://github.com/smt116.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Native Loader\n\nPackage for loading native files in Node and Electron applications. The project is inspired by the [node-addon-loader](https://github.com/ushu/node-addon-loader). It works in the similar way but **allows to build path at runtime**.\n\n## Installation\n\nAdd the package to the development dependencies:\n\n```bash\n# using npm:\n$ npm install native-ext-loader --save-dev\n\n# using yarn:\n$ yarn add --dev native-ext-loader\n```\n\n## Usage\n\nUpdate rules entry in the Webpack configuration file:\n\n```js\nmodule: {\n  rules: [\n    {\n      test: /\\.node$/,\n      loader: \"native-ext-loader\"\n    }\n  ];\n}\n```\n\n## Options\n\nOptions are configurable using `options` hash:\n\n```js\nmodule: {\n  rules: [\n    {\n      test: /\\.node$/,\n      loader: \"native-ext-loader\",\n      options: {\n        rewritePath: path.resolve(__dirname, \"dist\")\n      }\n    }\n  ];\n}\n```\n\n### `basePath` (default: `[]`)\n\nIt allows adjusting path to the native module. The array will be concatenated with the resource name and then used in the runtime. For example, when the compile application lives inside `app.asar/renderer` subdirectory (Electron package), the path to the native module can be adjusted by using `basePath: ['app.asar', 'renderer']`.\n\nNote that `basePath` is ignored when `rewritePath` option is used.\n\n### `rewritePath` (default: `undefined`)\n\nIt allows to set an absolute paths to native files.\n\nNote that it needs to remain `undefined` if you are building a package with embedded files. This way, the compiled application will work no matter of its location. This is important when building Electron applications that can be placed in any directory by the end user.\n\n### `emit` (default: `true`)\n\nSpecifies whether the imported `.node` file will be copied to the output directory.\n\n## Releasing a new version\n\n1.  Bump version number in the `package.json` and `CHANGELOG.md` files.\n1.  Run `npm install` to update `package-lock.json` file.\n1.  Commit changes (include changes)\n1.  Add a new tag (use `-a` and include changes)\n1.  Push commits and tag\n1.  Run `npm publish`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmt116%2Fnode-native-ext-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmt116%2Fnode-native-ext-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmt116%2Fnode-native-ext-loader/lists"}