{"library":"packager","title":"Packager","description":"A browser-based trans-bundler that runs entirely in the browser, enabling code transformation and bundling without a server. Current version 0.1.9. It leverages existing bundler concepts for client-side use, focusing on ease of integration and in-browser workflows. Differentiates from server-side bundlers by operating fully in the browser environment, making it suitable for online editors or prototyping tools.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install packager"],"cli":null},"imports":["import packager from 'packager'","import type { BundleOptions } from 'packager'","import { bundle } from 'packager'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { bundle } from 'packager';\n\nconst code = `\nimport { foo } from './foo';\nconsole.log(foo);\n`;\n\nasync function run() {\n  const result = await bundle(code, {\n    resolve: (specifier) => {\n      if (specifier === './foo') {\n        return { code: 'export const foo = \"bar\";' };\n      }\n      throw new Error(`Cannot resolve ${specifier}`);\n    }\n  });\n  console.log(result.code);\n}\nrun();","lang":"typescript","description":"Shows how to bundle a simple ES module string with a custom resolver, outputting the transformed code.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}