{"library":"rollup-plugin-native","title":"rollup-plugin-native","description":"A Rollup plugin that enables importing native .node modules (N-API addons) by resolving platform-specific binary paths during bundling. Version 1.2.16, last updated in 2024, with low release cadence (no breaking changes in recent versions). It uses substitution patterns like ${nodePlatform} and ${nativeArchitecture} to dynamically select the correct precompiled binary for the current OS/arch, avoiding the need for node-gyp at runtime. Differentiators: simplifies cross-platform native module bundling without manual conditional requires, and integrates directly into Rollup's plugin system. No other known alternative for Rollup-focused native module import.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-native"],"cli":null},"imports":["import native from 'rollup-plugin-native'","import native from 'rollup-plugin-native'","/** @type {import('rollup-plugin-native').PluginOptions} */"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport native from 'rollup-plugin-native';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'cjs'\n  },\n  plugins: [\n    native({\n      platformName: 'precompiled/${nodePlatform}-${nodeArchitecture}/native.node'\n    })\n  ]\n};","lang":"javascript","description":"Configures Rollup to resolve native .node modules with platform-specific binary paths using substitution variables.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}