Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bagit-tools

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bagit-tools

collection of modules to manage BagIt bags

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bagit-tools

collection of modules to manage BagIt bags

npm travis standard

Install

npm install bagit-tools

Usage

var bagitTools = require('bagit-tools')

Verify Bag

var bagDir = '/downloads/my-bag'
bagTools.verify(bagDir, function (err, valid, results) {
  if (err) throw err
  if (valid) console.log('VALID')
  else console.log('FAIL')
})

Results is an array of TAP test objects for each verification step. Run against the LOC bagit-conformance-suite with npm test.

Bag Test Verification Status
  • 1.0 - All passing
  • 0.97 - Valid/Invalid Passing, Warnings need some work
  • ... earlier version before 0.97 all valid

Bag Fs

Read and write from bags with an fs-like API via bagit-fs.

var bagFs = require('bagit-tools').fs
var bag = bagFs('/put/bag/here', 'sha256', {'Contact-Name': 'Joe Hand'})

// write files to bag's data folder
fs.createReadStream('readme.md').pipe(bag.createWriteStream('/readme.md'))

// ... LATER after all files are written
bag.finalize(function () {
  console.log('finalized')
})

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

MIT

Keywords

FAQs

Package last updated on 14 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc