{"_id":"@bosagora/sdk-ipfs","_rev":"4-48876e61025f47a302f8a62ed7b7d676","name":"@bosagora/sdk-ipfs","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@bosagora/sdk-ipfs","version":"1.0.0","author":{"name":"BOSagora Association"},"license":"MIT","_id":"@bosagora/sdk-ipfs@1.0.0","maintainers":[{"name":"bosagoradev","email":"dev@bosagora.io"},{"name":"hyeonyeobkim","email":"hyeonyeob.kim@bosagora.io"},{"name":"youngsoo.jung","email":"youngsoo.jung@bosagora.io"},{"name":"michaelkim20","email":"michael.kim.200518@gmail.com"}],"dist":{"shasum":"e47b4a0c6268ade37816ae770c9e75363e080b9d","tarball":"https://registry.npmjs.org/@bosagora/sdk-ipfs/-/sdk-ipfs-1.0.0.tgz","fileCount":17,"integrity":"sha512-5c6BUoZ0QAFqOxEdneb29GrA0OK4I3Y0QI25tag0DAf+UWJ8BRs/s+7gyBZ/5Xv/zAy2oMUXF9baQR/A1HeyfQ==","signatures":[{"sig":"MEUCIQDD7zoEMBFd6ZMYbOzYACsYz+rdw2X2oZKCEygNFZvjLAIgEzHvAWh3FKbCnRne4wJDkYAYHn1VYIDJ+75Omw+pYzo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":201753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkL6xuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrV7g/+M5MtOzKU3CdTz5h1Mg9+AWbZegzCqouyzjNecFdrCZY/GNEN\r\n6QB4iwfnjXW/NcOfqkTusO4hYuKiigd21Fki4HZ4qyy0BCaai7qeG5PFEN5c\r\nkCFiIAXkgFPHTn9UuD67nkv/cgkntD+PmaoMcydG7UUBUJRzaBhqj+oT7s15\r\nosTDwbVCy3g7r1AisJsaBhf1QuI/xH6Wu4akLY8gK2wqMaE0idxzxEAP0Gp4\r\nilfx3mhy42jLMslGRrGY5+Gq7//lFiVyDsf91RzziBNxJ/QISwdTclkNwUHt\r\nElpM1aKjrpK08pIn+BepEnWQCrneGjvnVjrqke16ElmxveXw84ycGfNMaNpO\r\nyg6YbPHITcBpanczpso0e7qclr39Gito5n5Hk9ydKppxYX31MGDHu5UgngQw\r\nK+TrSI7EsEvf3fzMy+gyZK6SZtlWWUPlsx/15ZpKHacb1b31+FSy8S3nQy67\r\naigj/qhwLZpJ264PGE9e+XxzZbEzSEAfGKuDPYQ7OiL6I7xdGNLD7I54xb0r\r\n+7vQcQtdEaEQ3b5D53sdDGeXK685qKBw6uVnHj9d31WjY23gU0F+hhipvxjo\r\nVbL7HvmwtQU1eH94ruolpjVLvCGZ/7oE+ZzbjCi/qKBJpTh6YeIWVfeUKtSc\r\nYaUIIELnKcPNiCRxCmlnQg/FkKxVN9gCt7I=\r\n=2i0O\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testTimeout":20000,"testEnvironment":"../../test-environment.js"},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint --fix"}},"module":"dist/sdk-ipfs.esm.js","engines":{"node":">=16"},"gitHead":"f8b25563090c8eb733cf2a2e77f836cdbf828ec5","scripts":{"lint":"tsdx lint","size":"size-limit","test":"TESTING=true tsdx test --verbose","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"bosagoradev","email":"dev@bosagora.io"},"prettier":{"semi":true,"printWidth":80,"singleQuote":false,"trailingComma":"es5"},"size-limit":[{"path":"dist/sdk-ipfs.cjs.production.min.js","limit":"10 KB"},{"path":"dist/sdk-ipfs.esm.js","limit":"10 KB"}],"_npmVersion":"8.19.3","description":"@bosagora/sdk-ifps provides a wrapper to send requests to an IPFS Cluster using the IPFS API. It supports standard requests as well as streamed requests.","directories":{},"_nodeVersion":"16.19.0","dependencies":{"@web-std/file":"^3.0.2","@web-std/fetch":"^4.1.0","@web-std/form-data":"^3.0.2","isomorphic-unfetch":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^7.0.4","tslib":"^2.3.1","size-limit":"^7.0.8","typescript":"^4.6.2","@size-limit/preset-small-lib":"^7.0.8"},"_npmOperationalInternal":{"tmp":"tmp/sdk-ipfs_1.0.0_1680845934550_0.9511661812466727","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@bosagora/sdk-ipfs","version":"1.0.1","author":{"name":"Aragon Association"},"license":"MIT","_id":"@bosagora/sdk-ipfs@1.0.1","maintainers":[{"name":"bosagoradev","email":"dev@bosagora.io"},{"name":"hyeonyeobkim","email":"hyeonyeob.kim@bosagora.io"},{"name":"youngsoo.jung","email":"youngsoo.jung@bosagora.io"},{"name":"michaelkim20","email":"michael.kim.200518@gmail.com"}],"dist":{"shasum":"d333aedabe2593045f7289fb274893e5b84e108e","tarball":"https://registry.npmjs.org/@bosagora/sdk-ipfs/-/sdk-ipfs-1.0.1.tgz","fileCount":16,"integrity":"sha512-k7yI0LUPLvd5hQcr2JI4JNKcI0YCwhMh1p4dK4hsUrw2klTO+tNBEYsSy9Blijeeo20MAPXB4IwGhSlYkSSOVQ==","signatures":[{"sig":"MEUCIQCZiPPQzORaoOtLYHoERafIuJZbXsTP2HXWBPs0nquviQIgRn1UhVRhg9VprSVD1YUpWLMpLlsAgA9TuFdUG56uCI4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":187983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMqgXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpI4g//Rvx67gLdKPtWh5zHdQAqMpn2ps8QClpp43+LG/oyRD8ORFmT\r\nmCmGfURjnDV9Zvqz3ul5ju9aWHBSW0cscf/xpj+8o0dsduPFUWq0wsRbaSlt\r\n2sDW8m1Ezd5PLIxX53f9NxI6JwJLEK1B5sONdpEWXOUu+3N3zRU5mfYTZf/O\r\nrDKl+BpTlwGgQXj1ew7/5csI9Gv5/QVqe+UFBVWWIlh7fxW+8x34rFUqxBZV\r\nbTPap5HYpH2ijvPulHluiNHX9gch7mvBVZHIecUQhJrFYiFpL/poSF8IOOYo\r\nVTC13+orAQr88+BupxV4nElLqOFaBVqGHfz5QkP69NgtTWzRWXze0wFPOydt\r\nOkSHRQvPGpkywqaQZ8kY3fCoOplFRre/D0hjtyyhpQ/+qQOSQBT3YQNoSDzj\r\n+7CP8545Dv7R+F/2tTvU+kbDFu1bkJmBLA62gZGUZuzWDTTY4YrssoUlqNAd\r\nD/Fb5y9844UZeZB57s4fdqyJHZCM0Df2smLQLiP1BUQBk5hhJJ8NE0qFa5am\r\nZU6rdr6uhJTwySJfibAAVQMHI1f4eu+nMoqpAwntKvWBELwb4i8VMJDEk/77\r\nlvWUOk1JI7T29UYKodxhQBUeM5/D/68O0wO/D8HmfFdzeoELud44bVqBOQu0\r\n9ga5nlVYu9w88QV6EkRrUOLXl5sjy6q+wGc=\r\n=qa9O\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testTimeout":20000,"testEnvironment":"../../test-environment.js"},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint --fix"}},"module":"dist/sdk-ipfs.esm.js","engines":{"node":">=16"},"gitHead":"0c9a768fd3700caa67882ffe511bcf4a62d4f553","scripts":{"lint":"tsdx lint","size":"size-limit","test":"TESTING=true tsdx test --verbose","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"bosagoradev","email":"dev@bosagora.io"},"prettier":{"semi":true,"printWidth":80,"singleQuote":false,"trailingComma":"es5"},"size-limit":[{"path":"dist/sdk-ipfs.cjs.production.min.js","limit":"10 KB"},{"path":"dist/sdk-ipfs.esm.js","limit":"10 KB"}],"_npmVersion":"8.5.1","description":"@bosagora/sdk-ifps provides a wrapper to send requests to an IPFS Cluster using the IPFS API. It supports standard requests as well as streamed requests.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"@web-std/file":"^3.0.2","@web-std/fetch":"^4.1.0","@web-std/form-data":"^3.0.2","isomorphic-unfetch":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^7.0.4","tslib":"^2.3.1","size-limit":"^7.0.8","typescript":"^4.6.2","@size-limit/preset-small-lib":"^7.0.8"},"_npmOperationalInternal":{"tmp":"tmp/sdk-ipfs_1.0.1_1681041431709_0.8183068309687878","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@bosagora/sdk-ipfs","version":"1.0.2","author":{"name":"Aragon Association"},"license":"MIT","_id":"@bosagora/sdk-ipfs@1.0.2","maintainers":[{"name":"bosagoradev","email":"dev@bosagora.io"},{"name":"hyeonyeobkim","email":"hyeonyeob.kim@bosagora.io"},{"name":"youngsoo.jung","email":"youngsoo.jung@bosagora.io"},{"name":"michaelkim20","email":"michael.kim.200518@gmail.com"}],"dist":{"shasum":"027568f44df81723215d5770d77fee32be3d5423","tarball":"https://registry.npmjs.org/@bosagora/sdk-ipfs/-/sdk-ipfs-1.0.2.tgz","fileCount":17,"integrity":"sha512-/sE2AfC05WGTsGTjZsqwxUUtq9qao6dsaQyKbxWdE0NvGKgyb86DFVAcS7jfXm8lqTYFNEMH45eceN62ArkBGQ==","signatures":[{"sig":"MEUCIHGQ9xII07p9MjDP+gGQ5vew0O3i2Hpha5GDOUZZWHEyAiEAgCD2fhJexOfN0EFGQGj5GyOKcfY9S+MyPEkDOwojWrM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":201743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMrPsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6tg//aHFJ6RdgZQ1Sd36YEBD9h5ijv8LKNUTjGMvly2QvbrDA500F\r\n4HdsPnP28MiL9N2j06DK8m8kFQ033MTVHxlB2ftAVF8Pjfimw1O5JaadeOc1\r\n0H5XeUOe3eNS8Y+VmfnMSLG+56Jyyfa/qgnsd5t0lmOBv22Mtz7DDUprGpUp\r\nNy41lm3Hq/FGmAiXBVXOaJNUF9NFj4EyqNulG6N75wk4HXNpZw6ARtXPtpi+\r\n40ynA9JzRQaQCqmanLgO41kvIakRqb19Eohny/PQcR9NOhQJso7CNbBCIqzH\r\ngD5qbp2WrtXh/M61HKZlcmOe783uEQjkS4hgFW8dfXJgqa4TXFRbYWvAXSiN\r\nD3Z3EmlZNXRu4RXWuoffe55Qcb9Mkww/Qbh1f3NjCh5Ah5AxQJ+IrC/aFx3l\r\nLMvU2V836KMTAPvkHx4PMvf+AUy9vQA4O3HIlroeyRrBOrCWwCO+TdtpiqWS\r\nFK80QwuOnXDVhsi2/ncJAko6xmokbXQj83XXepHbhPZ6pBgYzIAvY1D5TX64\r\nrU6GkorUqXmRtLHiKEzkko9p6uoIJKQb8Q84tuGF0hciBifgRh1PhPZMctPv\r\nVVTZ1TwPPpJtY0jada8ZHv5hzxmEgbtAbpkYVLS+oS7tTx8yovNNzG2deozD\r\nN8pADeXLhE7mwH0bZmMpdccx4IlCi1LRhQM=\r\n=/gls\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testTimeout":20000,"testEnvironment":"../../test-environment.js"},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint --fix"}},"module":"dist/sdk-ipfs.esm.js","engines":{"node":">=16"},"gitHead":"f8b25563090c8eb733cf2a2e77f836cdbf828ec5","scripts":{"lint":"tsdx lint","size":"size-limit","test":"TESTING=true tsdx test --verbose","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"bosagoradev","email":"dev@bosagora.io"},"prettier":{"semi":true,"printWidth":80,"singleQuote":false,"trailingComma":"es5"},"size-limit":[{"path":"dist/sdk-ipfs.cjs.production.min.js","limit":"10 KB"},{"path":"dist/sdk-ipfs.esm.js","limit":"10 KB"}],"_npmVersion":"8.5.1","description":"@bosagora/sdk-ifps provides a wrapper to send requests to an IPFS Cluster using the IPFS API. It supports standard requests as well as streamed requests.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"@web-std/file":"^3.0.2","@web-std/fetch":"^4.1.0","@web-std/form-data":"^3.0.2","isomorphic-unfetch":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^7.0.4","tslib":"^2.3.1","size-limit":"^7.0.8","typescript":"^4.6.2","@size-limit/preset-small-lib":"^7.0.8"},"_npmOperationalInternal":{"tmp":"tmp/sdk-ipfs_1.0.2_1681044459814_0.6416891410291083","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@bosagora/sdk-ipfs","version":"1.0.3","author":{"name":"Aragon Association"},"license":"MIT","_id":"@bosagora/sdk-ipfs@1.0.3","maintainers":[{"name":"bosagoradev","email":"dev@bosagora.io"},{"name":"hyeonyeobkim","email":"hyeonyeob.kim@bosagora.io"},{"name":"youngsoo.jung","email":"youngsoo.jung@bosagora.io"},{"name":"michaelkim20","email":"michael.kim.200518@gmail.com"}],"dist":{"shasum":"c136538f268e1f6a11050e4d5a34353af354d355","tarball":"https://registry.npmjs.org/@bosagora/sdk-ipfs/-/sdk-ipfs-1.0.3.tgz","fileCount":16,"integrity":"sha512-xqksOYZd1fNkLBomtFlRTNpAZSqaeOY0P/yS/EJ1UzWnBsXZPdPM7rE59j/qMJvMH4ZaGONE2f8jZOuxj9tU8g==","signatures":[{"sig":"MEUCIQD8A9eTVs4F9zFoE2m3vyD2ZYNyA3CEyBklJu0hNWVJngIgFTiyxaU9SzrO1mLgt9FA/snN70UenGdZvC08sorMors=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":187983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMrrpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrw6Q/+N3OZXt+GjJdMIk5y2gm0fflsYJRBiRo0nfkqStxqRD3mtl/o\r\nI1khVWUs0eJx0/Jx3lKacfaWuGKDa8YdxoIWm8jRv+fne9ePh70HsG2Z14Zy\r\nLhPq1yASZGGzKnWv75YhEISY58KJaXUOn8ixayurWn/SAo4q7OQChvyWFc79\r\nyGHWA/Tw52I5POsFkwXzNlNvobhqDlPlu8yLF4Yoj3sbtIGfbQtZYbTjHJAA\r\npWbGVJkiG8FGgJcsGoA/EPoszDJx4FKbq/1ZmWxybjeHp+yL86C8s6AbI5K7\r\naCe8Oloy4RWl30NAAc/kYQBaXnXEL5F7ifWRgOfuGxAHRBGUip/GjlhqRzP/\r\nT3eqY1ettDtaix8aEjMezKjQFQiXzV2lqbU63T+BA14vvx9K0AV0opJp53Vu\r\nGaYm66zzWKpg14nvr7gkOZXp4Vwuy6eAC2gsn4833OSoV8EEBH2cC3sUV55i\r\nkap0aDsvFwsWheqDxfDncYh80cjnCL/NpgCou/CWIRWN28qVetCyR3gqFd8y\r\nTrIZh/JgTS8MvUWJltnz8tvhLlQ9rZPbM9kCObABeFrxjwKUr9YlZXkqLPNp\r\nQHTp9VeUHsrnANkKowqUQNAk/KrMp0DlYnkjJya6+RCZtUQYI4UpskgK6jet\r\n3zhmoCYTHq7G7lQ8mGkvTN8XA77tcb3crH8=\r\n=qP6d\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testTimeout":20000,"testEnvironment":"../../test-environment.js"},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint --fix"}},"module":"dist/sdk-ipfs.esm.js","engines":{"node":">=16"},"gitHead":"7695e49eaaba538081f0a94e5c0331184cd5b7d5","scripts":{"lint":"tsdx lint","size":"size-limit","test":"TESTING=true tsdx test --verbose","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"bosagoradev","email":"dev@bosagora.io"},"prettier":{"semi":true,"printWidth":80,"singleQuote":false,"trailingComma":"es5"},"size-limit":[{"path":"dist/sdk-ipfs.cjs.production.min.js","limit":"10 KB"},{"path":"dist/sdk-ipfs.esm.js","limit":"10 KB"}],"_npmVersion":"8.5.1","description":"@bosagora/sdk-ifps provides a wrapper to send requests to an IPFS Cluster using the IPFS API. It supports standard requests as well as streamed requests.","directories":{},"_nodeVersion":"16.14.0","dependencies":{"@web-std/file":"^3.0.2","@web-std/fetch":"^4.1.0","@web-std/form-data":"^3.0.2","isomorphic-unfetch":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^7.0.4","tslib":"^2.3.1","size-limit":"^7.0.8","typescript":"^4.6.2","@size-limit/preset-small-lib":"^7.0.8"},"_npmOperationalInternal":{"tmp":"tmp/sdk-ipfs_1.0.3_1681046249059_0.24348508837414196","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-04-07T05:38:54.485Z","modified":"2024-12-05T03:44:49.563Z","1.0.0":"2023-04-07T05:38:54.791Z","1.0.1":"2023-04-09T11:57:11.919Z","1.0.2":"2023-04-09T12:47:39.992Z","1.0.3":"2023-04-09T13:17:29.248Z"},"author":{"name":"Aragon Association"},"license":"MIT","description":"@bosagora/sdk-ifps provides a wrapper to send requests to an IPFS Cluster using the IPFS API. It supports standard requests as well as streamed requests.","maintainers":[{"email":"michael.kim.200518@gmail.com","name":"michaelkim20"},{"email":"youngsoo.jung@bosagora.io","name":"youngsoo.jung"},{"email":"dev@bosagora.io","name":"bosagoradev"}],"readme":"# Aragon JS SDK IPFS\n\n@bosagora/sdk-ifps provides a wrapper to send requests to an IPFS Cluster using\nthe IPFS API. It supports standard requests as well as streamed requests.\n\n# Installation\n\nUse [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) to install\n@bosagora/sdk-ipfs.\n\n```bash\nnpm install @bosagora/sdk-ipfs\nyarn add @bosagora/sdk-ipfs\n```\n\n# Usage\n\n## IPFS Client\n\nThe Aragon infrastructure uses an IPFS cluster which requires authentication\nbased on an API key. The provided `Client` works as well on any canonical\ndeployment by just not providing any API key in the headers.\n\n```ts\nimport { Client as IpfsClient } from \"@bosagora/sdk-ipfs\";\n\nconst headers = {\n  \"X-API-KEY\": \"1234...\",\n};\nconst client = new IpfsClient(clusterUrl, headers);\n```\n\n## Node info\n\nRetrieves the details of the node behind the endpoint.\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst versionInfo = await client.nodeInfo();\nconsole.log(versionInfo);\n// {\n//   id: string;\n//   addresses: string[];\n//   agentVersion: string;\n//   protocolVersion: string;\n//   protocols: string[];\n//   publicKey: string;\n// }\n```\n\n## IPFS add\n\nUploads data to the IPFS cluster and returns the hash of the newly pinned file.\nThe following data types are supported:\n\n### As a `string` _(preferred)_\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst content = \"I am a test\";\nconst { hash } = await client.add(content);\nconsole.log(hash);\n// QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\n```\n\n### `Uint8Array` _(preferred)_\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst content = Uint8Array([73, 32, 97, 109, 32, 97, 32, 116, 101, 115, 116]);\nconst { hash } = await client.add(content);\nconsole.log(hash);\n// QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\n```\n\n### `File` _(browser-only)_\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst content = new File([\"I am a test\"], \"test.txt\", { type: \"text/plain\" });\nconst { hash } = await client.add(content);\nconsole.log(hash);\n// QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\n```\n\n### `Blob` _(browser-only)_\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst content = new File([\"I am a test\"], { type: \"text/plain\" });\nconst { hash } = await client.add(content);\nconsole.log(hash);\n// QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\n```\n\n## IPFS cat\n\nFetches the content behind the given CiD and returns it as a `Uint8Array`.\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst cid = \"QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\";\nconst recoveredBytes = await client.cat(cid);\nconsole.log(recoveredBytes);\n// Uint8Array(11) [\n//    73, 32,  97, 109,  32,\n//    97, 32, 116, 101, 115,\n//   116\n// ]\n```\n\n### Decoding as text\n```ts\nconst recoveredString = new TextDecoder().decode(recoveredBytes);\nconsole.log(recoveredString);\n// I am a test\n```\n\n## IPFS pin\n\nRequests the node to keep a local copy of the data behind the given CiD.\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst cid = \"QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\";\nconst { pins } = await client.pin(cid);\nconsole.log(pins);\n// [\"QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\"]\n```\n\n**Note:** Using IPFS pin on the Aragon IPFS cluster may be restricted. Use IPFS add instead.\n\n## IPFS unpin\n\nRequests the node to keep a local copy of the data behind the given CiD.\n\n```ts\nconst client = new IpfsClient(clusterUrl, headers);\n\nconst cid = \"QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\";\nconst { pins } = await client.unpin(cid);\nconsole.log(pins);\n// [\"QmeJ4kRW21RRgjywi9ydvY44kfx71x2WbRq7ik5xh5zBZK\"]\n```\n\n**Note:** Using IPFS unpin on the Aragon IPFS cluster may be restricted. \n\n# Testing\n\nTo execute library tests just run:\n\n```bash\nyarn build\nyarn test\n```\n","readmeFilename":"README.md"}