tableflip/js-cid

Name: js-cid

Owner: TABLEFLIP

Description: CID implementation in JavaScript

Created: 2018-03-08 12:30:21.0

Updated: 2018-03-08 12:30:23.0

Pushed: 2018-03-08 12:41:02.0

Homepage: null

Size: 58

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

js-cid

Coverage Status Travis CI Circle CI Dependency Status js-standard-style

CID implementation in JavaScript.

Table of Contents
Install
In Node.js through npm
m install --save cids
Browser: Browserify, Webpack, other bundlers

The code published to npm that gets loaded on require is in fact an ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.

t CID = require('cids')
In the Browser through <script> tag

Loading this module through a script tag will make the `Cids` obj available in the global namespace.

ipt src="https://unpkg.com/cids/dist/index.min.js"></script>
 OR -->
ipt src="https://unpkg.com/cids/dist/index.js"></script>
Gotchas

You will need to use Node.js Buffer API compatible, if you are running inside the browser, you can access it by multihash.Buffer or you can install Feross's Buffer.

Usage
t CID = require('cids')

1 CID
t cid = new CID(1, 'dag-pb', multihash)

0 CID
t cid = new CID(base58Multihash)
API

See https://ipld.github.io/js-cid

Contribute

Contributions welcome. Please check out the issues.

Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS Code of Conduct.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.