{"name":"ipns","version":"10.1.1","keywords":["ipfs","ipns"],"author":{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},"license":"Apache-2.0 OR MIT","_id":"ipns@10.1.1","maintainers":[{"name":"jacobheun","email":"jacobheun@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@ipfs.tech"}],"homepage":"https://github.com/ipfs/js-ipns#readme","bugs":{"url":"https://github.com/ipfs/js-ipns/issues"},"dist":{"shasum":"b786c9009854ca8b47911ca8e49d73a94faab936","tarball":"http://registry-npm.ywwl.com/ipns/download/ipns-10.1.1.tgz","fileCount":36,"integrity":"sha512-m5JszTcnAFaBDS3PWM6lVBc5WSDftm0pjU78kJ4Wvf4Pjg/rogMdg3rzLXvzh8qCr0N0ugEaDf+c8MXhUWNW5w==","signatures":[{"sig":"MEYCIQCB15bJUeLtWZ4Or1+hFF1s+Vtpz9x9mTSbB7LxXov4ewIhAOOYMIdIMLXTeL2eHS6H/BjiNYJBzZxvKiF7nCAx+gqF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ipns@10.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1031177,"size":268990,"noattachment":false,"key":"/ipns/-/ipns-10.1.1.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./selector":{"types":"./dist/src/selector.d.ts","import":"./dist/src/selector.js"},"./validator":{"types":"./dist/src/validator.d.ts","import":"./dist/src/validator.js"}},"gitHead":"26669fcadfb7b7d53587bac72ec645e202df2c36","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"]}]],"branches":["main"]},"scripts":{"docs":"NODE_OPTIONS=--max_old_space_size=8192 aegir docs","lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","release":"aegir release","generate":"protons src/pb/ipns.proto","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","docs:no-publish":"NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false","test:electron-main":"aegir test -t electron-main","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@ipfs.tech"},"repository":{"url":"git+https://github.com/ipfs/js-ipns.git","type":"git"},"_npmVersion":"10.9.3","description":"IPNS record definitions","directories":{},"sideEffects":false,"_nodeVersion":"22.17.0","dependencies":{"cborg":"^4.2.3","uint8arrays":"^5.1.0","multiformats":"^13.2.2","@libp2p/crypto":"^5.0.0","@libp2p/logger":"^5.0.0","timestamp-nano":"^1.0.1","uint8arraylist":"^2.4.8","protons-runtime":"^5.5.0","@libp2p/interface":"^2.0.0","interface-datastore":"^8.3.0"},"publishConfig":{"access":"public","provenance":true},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^47.0.20","protons":"^7.6.0","@libp2p/peer-id":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ipns_10.1.1_1752227896175_0.7639036061982416","host":"s3://npm-registry-packages-npm-production"},"readme":"# ipns\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-ipns.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipns)\n[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-ipns/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/ipfs/js-ipns/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> IPNS record definitions\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\nImplements parsing and serialization of [IPNS Records](https://specs.ipfs.tech/ipns/ipns-record/).\n\n## Example - Create record\n\n```TypeScript\nimport { createIPNSRecord } from 'ipns'\nimport { generateKeyPair } from '@libp2p/crypto/keys'\n\nconst privateKey = await generateKeyPair('Ed25519')\nconst value = 'hello world'\nconst sequenceNumber = 0\nconst lifetime = 3_600_000 // ms, e.g. one hour\n\nconst ipnsRecord = await createIPNSRecord(privateKey, value, sequenceNumber, lifetime)\n```\n\n## Example - Validate record against public key\n\n```TypeScript\nimport { validate } from 'ipns/validator'\nimport { generateKeyPair } from '@libp2p/crypto/keys'\n\nconst privateKey = await generateKeyPair('Ed25519')\nconst publicKey = privateKey.publicKey\nconst marshalledRecord = Uint8Array.from([0, 1, 2, 3])\n\nawait validate(publicKey, marshalledRecord)\n// if no error thrown, the record is valid\n```\n\n## Example - Validate record against routing key\n\nThis is useful when validating IPNS names that use RSA keys, whose public key is embedded in the record (rather than in the routing key as with Ed25519).\n\n```TypeScript\nimport { ipnsValidator } from 'ipns/validator'\nimport { multihashToIPNSRoutingKey } from 'ipns'\nimport { generateKeyPair } from '@libp2p/crypto/keys'\n\nconst privateKey = await generateKeyPair('Ed25519')\nconst routingKey = multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash())\nconst marshalledRecord = Uint8Array.from([0, 1, 2, 3])\n\nawait ipnsValidator(routingKey, marshalledRecord)\n```\n\n## Example - Extract public key from record\n\n```TypeScript\nimport { extractPublicKeyFromIPNSRecord, createIPNSRecord } from 'ipns'\nimport { generateKeyPair } from '@libp2p/crypto/keys'\n\nconst privateKey = await generateKeyPair('Ed25519')\nconst record = await createIPNSRecord(privateKey, 'hello world', 0, 3_600_000)\n\nconst publicKey = await extractPublicKeyFromIPNSRecord(record)\n```\n\n## Example - Marshal data with proto buffer\n\n```TypeScript\nimport { createIPNSRecord, marshalIPNSRecord } from 'ipns'\nimport { generateKeyPair } from '@libp2p/crypto/keys'\n\nconst privateKey = await generateKeyPair('Ed25519')\nconst record = await createIPNSRecord(privateKey, 'hello world', 0, 3_600_000)\n// ...\nconst marshalledData = marshalIPNSRecord(record)\n// ...\n```\n\nReturns the record data serialized.\n\n## Example - Unmarshal data from proto buffer\n\n```TypeScript\nimport { unmarshalIPNSRecord } from 'ipns'\n\nconst storedData = Uint8Array.from([0, 1, 2, 3, 4])\nconst ipnsRecord = unmarshalIPNSRecord(storedData)\n```\n\nReturns the `IPNSRecord` after being deserialized.\n\n# Install\n\n```console\n$ npm i ipns\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make its exports available as `Ipns` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/ipns/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://ipfs.github.io/js-ipns>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/js-ipns/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipns/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribute\n\nContributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipns/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":1752227896407,"_cnpm_publish_time":1752227896407,"dist-tags":{"beta":"0.2.2","latest":"11.0.1"}}