Socket
Book a DemoInstallSign in
Socket

bare-bundle-compile

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-bundle-compile

Compile a bundle of CommonJS modules to a single module

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
2
Created
Source

bare-bundle-compile

Compile a bundle of CommonJS modules to a single module.

npm i bare-bundle-compile

Usage

const Bundle = require('bare-bundle')
const compile = require('bare-bundle-compile')

const bundle = new Bundle()
  .write('/foo.js', "module.exports = require('./bar')", {
    main: true,
    imports: {
      './bar': '/bar.js'
    }
  })
  .write('/bar.js', 'module.exports = 42')

eval(compile(bundle)).exports
// 42

API

const code = compile(bundle)

License

Apache-2.0

FAQs

Package last updated on 10 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts