@web4/bitdrive-promise
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

bitdrive-promise

An async/await based wrapper for bitdrive (v10+)

Install

$ npm install @web4/bitdrive-promise

Usage

bitdrive-promise its totally API compatible with bitdrive v10+. It's only a promise based wrapper.

E.g.:

const bitdrive = require('@web4/bitdrive-promise')
const archive = bitdrive('./my-first-bitdrive') // content will be stored in this folder

try {
  await archive.writeFile('/hello.txt', 'world')
  const list = await archive.readdir('/')
  console.log(list) // prints ['hello.txt']
  const data = await archive.readFile('/hello.txt', 'utf-8')
  console.log(data) // prints 'world'
} catch (err) {
  console.log(err)
  // deal with the err
}

Release

npm version && npm publish

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

Dependents (1)

Package Sidebar

Install

npm i @web4/bitdrive-promise

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

4.73 kB

Total Files

5

Last publish

Collaborators

  • neothawreww