1.0.0 • Published 8 months ago

bare-bundle-id v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

bare-bundle-id

Construct a unique ID for a bundle.

npm i bare-bundle-id

Usage

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

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

bundle.id = id(bundle).toString('hex')
// 33824862...

API

const buffer = id(bundle)

License

Apache-2.0

1.0.0

8 months ago