{"id":22257,"library":"rollup-plugin-thatworks","title":"rollup-plugin-thatworks","description":"A collection of Rollup plugins providing chmod (set executable permissions), directory resolver (allow bare directory imports), and shebang (preserve #! lines) functionality. Current version is 1.0.4, maintained by Harald Rudell. The package bundles three distinct plugins useful for building Node.js CLI executables with Rollup. It has a slow release cadence and is a niche alternative to using individual plugins like rollup-plugin-chmod, rollup-plugin-node-resolve with custom options, and rollup-plugin-preserve-shebang.","status":"active","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/haraldrudell/rollup-plugin-thatworks","tags":["javascript","plugin","executable","resolve","node-resolve","rollup"],"install":[{"cmd":"npm install rollup-plugin-thatworks","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-thatworks","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-thatworks","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports named functions, not a default export. Use destructured imports.","wrong":"import chmod from 'rollup-plugin-thatworks'","symbol":"chmod","correct":"import { chmod } from 'rollup-plugin-thatworks'"},{"note":"There is no subpath export; always import from the main package.","wrong":"const directoryResolver = require('rollup-plugin-thatworks/directoryResolver')","symbol":"directoryResolver","correct":"import { directoryResolver } from 'rollup-plugin-thatworks'"},{"note":"For CommonJS, require the whole object and destructure: const { shebang } = require('rollup-plugin-thatworks').","wrong":"const shebang = require('rollup-plugin-thatworks').shebang","symbol":"shebang","correct":"import { shebang } from 'rollup-plugin-thatworks'"},{"note":"The name 'debnugPlugin' is a typo (debug misspelled) but kept for backward compatibility.","wrong":null,"symbol":"debnugPlugin","correct":"import { debnugPlugin } from 'rollup-plugin-thatworks'"}],"quickstart":{"code":"// rollup.config.js\nimport { chmod, directoryResolver, shebang } from 'rollup-plugin-thatworks';\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/cli.mjs',\n    format: 'esm'\n  },\n  plugins: [\n    directoryResolver({ paths: 'src' }),   // import from 'dir' instead of '../dir'\n    shebang(),                              // preserve #!/usr/bin/env node\n    chmod({ mode: 0o755 })                  // set executable permissions\n  ]\n};","lang":"javascript","description":"A Rollup configuration that uses directoryResolver, shebang, and chmod plugins to build a CLI executable from ES modules."},"warnings":[{"fix":"Update Rollup to version 1.1 or higher.","message":"Requires Rollup 1.1+; incompatible with Rollup 0.x.","severity":"breaking","affected_versions":">=0.1.2"},{"fix":"Use import { debnugPlugin } but be aware it's misspelled; alternate plugin rollup-plugin-debug exists.","message":"The name 'debnugPlugin' is a typo and may be removed in a future major version.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Ensure directories have an index.js or index.mjs file; for file resolution, use rollup-plugin-node-resolve.","message":"directoryResolver only works for directory imports; does not resolve file extensions.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rollup-plugin-thatworks --save-dev'","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'rollup-plugin-thatworks'"},{"fix":"Change 'import chmod from ...' to 'import { chmod } from ...'","cause":"Importing default instead of named export.","error":"TypeError: chmod is not a function"},{"fix":"Ensure the input file's shebang is on the very first line (line 1).","cause":"source file contains #! not on first line or output code has added extra lines before shebang.","error":"Error: [plugin: shebang] Shebang must come first in the file."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}