{"id":21926,"library":"rollup-plugin-bin","title":"rollup-plugin-bin","description":"Rollup plugin that prepends an executable shebang (#!/usr/bin/env node) to the output bundle, enabling CLI scripts. Version 1.0.0, stable but minimal, with no releases since 2020. Differentiators: lightweight, no dependencies, works with any output format. Not actively maintained; alternatives include @rollup/plugin-banner or manual banner injection.","status":"maintenance","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/SagaciousLittle/rollup-plugin-bin","tags":["javascript","rollup plugin","shell type","cli"],"install":[{"cmd":"npm install rollup-plugin-bin","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-bin","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-bin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The plugin exports a default function; named import is incorrect.","wrong":"const { bin } = require('rollup-plugin-bin')","symbol":"default","correct":"import bin from 'rollup-plugin-bin'"},{"note":"CJS require works, but ESM import also valid; preferred for modern projects.","wrong":"import bin from 'rollup-plugin-bin' in CommonJS","symbol":"default","correct":"const bin = require('rollup-plugin-bin')"},{"note":"In some bundler configurations, require may return an object with default key; verify your environment.","wrong":"const bin = require('rollup-plugin-bin')","symbol":"default","correct":"const bin = require('rollup-plugin-bin').default"}],"quickstart":{"code":"import bin from 'rollup-plugin-bin';\n\nexport default {\n  input: 'src/index.ts',\n  output: { file: 'bin/cli.js', format: 'cjs' },\n  plugins: [bin()]\n};","lang":"javascript","description":"Basic rollup config adding shebang to a CLI output file using rollup-plugin-bin."},"warnings":[{"fix":"Use chmod +x after build, or configure output.permissions in rollup.","message":"Plugin only prepends shebang; does not set executable permission on output file.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use @rollup/plugin-banner with custom shebang or fork plugin.","message":"No support for custom shebang strings other than default #!/usr/bin/env node.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider migrating to @rollup/plugin-banner or include banner manually via output.banner.","message":"Deprecated: Plugin is not actively maintained; may break with future rollup versions.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use import bin from 'rollup-plugin-bin' or const bin = require('rollup-plugin-bin').default.","cause":"Named import (import { bin } from 'rollup-plugin-bin') instead of default import.","error":"TypeError: bin is not a function"},{"fix":"Run npm install rollup-plugin-bin --save-dev and ensure correct require/import.","cause":"Package not installed or improper import path.","error":"Error: Cannot find module 'rollup-plugin-bin'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}