{"id":16698012,"url":"https://github.com/arlac77/rollup-plugin-native","last_synced_at":"2025-03-21T19:32:24.589Z","repository":{"id":35904057,"uuid":"220104790","full_name":"arlac77/rollup-plugin-native","owner":"arlac77","description":"import native (NAPI) modules","archived":false,"fork":false,"pushed_at":"2024-12-09T13:25:01.000Z","size":112,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T04:23:06.442Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arlac77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-06T22:47:18.000Z","updated_at":"2024-12-09T13:25:03.000Z","dependencies_parsed_at":"2023-11-06T12:28:37.992Z","dependency_job_id":"3d403959-74c9-48a9-868d-c4dd7181e06a","html_url":"https://github.com/arlac77/rollup-plugin-native","commit_stats":{"total_commits":127,"total_committers":6,"mean_commits":"21.166666666666668","dds":"0.35433070866141736","last_synced_commit":"e9d523fb0223b84a60c3ed9815505825ee2ceb6f"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Frollup-plugin-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Frollup-plugin-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Frollup-plugin-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Frollup-plugin-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arlac77","download_url":"https://codeload.github.com/arlac77/rollup-plugin-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244855592,"owners_count":20521666,"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-10-12T17:50:20.048Z","updated_at":"2025-03-21T19:32:24.280Z","avatar_url":"https://github.com/arlac77.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/arlac77/rollup-plugin-native.png)](http://travis-ci.org/arlac77/rollup-plugin-native)\n[![downloads](http://img.shields.io/npm/dm/rollup-plugin-native.svg?style=flat-square)](https://npmjs.org/package/rollup-plugin-native)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![minified size](https://badgen.net/bundlephobia/min/rollup-plugin-native)](https://bundlephobia.com/result?p=rollup-plugin-native)\n[![npm](https://img.shields.io/npm/v/rollup-plugin-native.svg)](https://www.npmjs.com/package/rollup-plugin-native)\n\n\n# rollup-plugin-native\n\nImport native code with Rollup.\n\nAs there is currently no support for\n```js\nimport {x} from \"module.node\"\n```\n\n## Installation\n\n```bash\nnpm install --save-dev rollup-plugin-native\n```\n\n\n## Usage\n\n```js\n// rollup.config.js\nimport native from 'rollup-plugin-native';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    file: 'public/bundle.js',\n    format: 'cfs'\n  },\n  plugins: [\n    native({\n    platformName: \"${dirname}/precompiled/${nodePlatform}-${nodeArchitecture}/node.napi.node\",\n    //platformName: \"${dirname}/${basename}-${nativePlatform}-${nativeArchitecture}.node\",\n    })\n  ]\n}\n```\n\n```js\nimport { funcA, constB } from \"../module.node\";\n\nfuncA(); // native call\n\n```\n\nwill generate a dlopen / require for\n\"../precompiled/linux-x86/node.napi.node\"\n\nSubstitution properties in the platformName \n- dirname dirname\n- basename basename (.node stiped away)\n- nodePlatform from process.platform()\n- nodeArchitecture from process.arch()\n- nativePlatform as given from uname\n- nativeArchitecture as used in llvm \u0026 gcc\n\n## License\n\nBSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlac77%2Frollup-plugin-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farlac77%2Frollup-plugin-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlac77%2Frollup-plugin-native/lists"}