{"name":"ipfs-unixfs","version":"0.3.0","description":"JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)","leadMaintainer":"Alex Potsides <alex.potsides@protocol.ai>","main":"src/index.js","browser":{"fs":false},"scripts":{"test":"aegir test -t node -t browser -t webworker","test:node":"aegir test -t node","test:browser":"aegir test -t browser","test:webworker":"aegir test -t webworker","build":"aegir build","lint":"aegir lint","release":"aegir release","release-minor":"aegir release --type minor","release-major":"aegir release --type major","coverage":"nyc -s aegir test -t node && nyc report --reporter=html"},"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-unixfs.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-unixfs/issues"},"engines":{"node":">=6.0.0","npm":">=3.0.0"},"homepage":"https://github.com/ipfs/js-ipfs-unixfs#readme","devDependencies":{"aegir":"^20.4.1","chai":"^4.2.0","dirty-chai":"^2.0.1","nyc":"^15.0.0"},"dependencies":{"err-code":"^2.0.0","protons":"^1.1.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"JGAntunes","email":"j.goncalo.antunes@gmail.com"},{"name":"Marcin Rataj","email":"lidel@lidel.org"},{"name":"Mithgol","email":"getgit@mithgol.ru"},{"name":"Pedro Teixeira","email":"i@pgte.me"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"Victor Bjelkholm","email":"victorbjelkholm@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"}],"gitHead":"ce4769e33f4bbc296fb27145f899cfe2165bfd25","_id":"ipfs-unixfs@0.3.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-0lyU0V7dMh9JAN9NPUrsT6Bf8nHpH5YPAbXByrf3snZzY5J5wuvKd9CIBgYAq1eIgTRmJIqfXGFtbD8RDchuoA==","shasum":"8cb0c8031c50f4d4c01d844b4877a5fde5fd23df","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs/download/ipfs-unixfs-0.3.0.tgz","fileCount":49,"unpackedSize":2151863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFdIPCRA9TVsSAnZWagAAcLkQAJqvH5NoeqDNKWRJAud8\nKZIRTanvi7jTLPqC1tBPpSflrDnOp03EYhnAiFXs5jirY6l8R+VESvhxOmrf\nAjkvNTO35Tlu+QtEnt1SPWVFcWRKPxwXz9GB9j8Ei/kTh6QVwem4psmSyQdW\nS5a7/G6xNAdFsN35hf+R9NQ6KkuGJDqS5QDTwvwsgeVBkalGjwqEeRlIFSZU\nxh654USPuKUTnlGQydUjoAq/uSh2S473mAKPUU8kaAZuZUlG9S58axJSlTAT\nDMYifljZgb8+zRe70ICKvr5/YOuKo3nOt8AXCdyNhH/J1uz5nGzsexTZmO9z\nWThCypfmUvcK6f7t/Tv1EI1VxTAI2UFs4aOg/P1HWP1YQHRmqRsA6N047z2y\n4HAwjRn6ZhpUAnEynEimgcaH2dMqJV901e1JQQwxRwSdZx63pE/zWesvOGgp\nI6ht+wC4qD8wbJKmdixYu1a/Z4IP+Q97lCG2MfiM+aHbI8O+6Nfj003gXvFY\nC6bGyU1LV0le5SSTbpS/aeJiJV+A+MBcllJCPCfHj33Ux5uCDgWv5RbaYU6g\nuTor4VtCcFiof7jxmos4e9uW3Z9MQ7Vcgs3j2asVDx/S1cZvT3cPU6avfhme\nYnOqz80YwoO7k7KSwmEshqKFkoevzJpQidXuWuxXoR8we3bti08TakjXco5n\nMkrV\r\n=PjNm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMY7BMs+q7o/E5piVvi9H3+pWb1yYD0GQzMsL7woIl9AIgVK2SlipqopFUfE1vere7sT+WqSHClGKO7wRn4CrF064="}],"size":1353637,"noattachment":false,"key":"/ipfs-unixfs/-/ipfs-unixfs-0.3.0.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs_0.3.0_1578488334553_0.5694525842553677"},"_hasShrinkwrap":false,"readme":"# ipfs-unixfs\n\n[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)\n[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)\n[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)\n[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-ipfs-unixfs/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nThis module contains the protobuf definition of the UnixFS data structure found at the root of all UnixFS DAGs.\n\nThe UnixFS spec can be found in the [ipfs/specs repository](http://github.com/ipfs/specs)\n\n## Example - Create a file composed of several blocks\n\n```JavaScript\nconst data = new UnixFS({ type: 'file' })\ndata.addBlockSize(256) // add the size of each block\ndata.addBlockSize(256)\n// ...\n```\n\n## Example - Create a directory that contains several files\n\nCreating a directory that contains several files is achieve by creating a unixfs element that identifies a MerkleDAG node as a directory. The links of that MerkleDAG node are the files that are contained in this directory.\n\n```JavaScript\nconst data = new UnixFS({ type: 'directory' })\n```\n\n## Example - Create an unixfs Data element\n\n```JavaScript\nconst data = new UnixFS([options])\n```\n\n`options` is an optional object argument that might include the following keys:\n\n- type (string, default `file`): The type of UnixFS entry.  Can be:\n  - `raw`\n  - `directory`\n  - `file`\n  - `metadata`\n  - `symlink`\n  - `hamt-sharded-directory`\n- data (Uint8Array): The optional data field for this node\n- blockSizes (Array, default: `[]`): If this is a `file` node that is made up of multiple blocks, `blockSizes` is a list numbers that represent the size of the file chunks stored in each child node. It is used to calculate the total file size.\n- mode (Number, default `0644` for files, `0755` for directories/hamt-sharded-directories) file mode\n- mtime (`Date`, `{ secs, nsecs }`, `{ Seconds, FractionalNanoseconds }`, `[ secs, nsecs ]`): The modification time of this node\n\n## Example - Add and remove a block size to the block size list\n\n```JavaScript\ndata.addBlockSize(<size in bytes>)\n```\n\n```JavaScript\ndata.removeBlockSize(<index>)\n```\n\n## Example - Get total fileSize\n\n```JavaScript\ndata.fileSize() // => size in bytes\n```\n\n## Example - Marshal and unmarshal\n\n```javascript\nconst marshaled = data.marshal()\nconst unmarshaled = Unixfs.unmarshal(marshaled)\n```\n\n## Example - Is this UnixFS entry a directory?\n\n```JavaScript\nconst dir = new Data({ type: 'directory' })\ndir.isDirectory() // true\n\nconst file = new Data({ type: 'file' })\nfile.isDirectory() // false\n```\n\n## Example - Has an mtime been set?\n\nIf no modification time has been set, no `mtime` property will be present on the `Data` instance:\n\n```JavaScript\nconst file = new Data({ type: 'file' })\nfile.mtime // undefined\n\nObject.prototype.hasOwnProperty.call(file, 'mtime') // false\n\nconst dir = new Data({ type: 'dir', mtime: new Date() })\ndir.mtime // { secs: Number, nsecs: Number }\n```\n\n# Install\n\n```console\n$ npm i ipfs-unixfs\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `IpfsUnixfs` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/ipfs-unixfs/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://ipfs.github.io/js-ipfs-unixfs/modules/ipfs_unixfs.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribute\n\nContributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).\n\nAlso see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.\n\nPlease be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)\n","publish_time":1578488334799,"_cnpm_publish_time":1578488334799,"dist-tags":{"latest":"13.1.2","next":"6.0.7-rc.5"}}