npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

bare-bundle-id

1.0.2

@kasperisager

npmHomeRepoSnykSocket
Downloads:852
$ npm install bare-bundle-id
DailyWeeklyMonthlyYearly

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