{"id":26121828,"url":"https://github.com/ipfs-shipyard/js-ipfs-level","last_synced_at":"2025-10-16T13:16:17.260Z","repository":{"id":57276572,"uuid":"92154301","full_name":"ipfs-shipyard/js-ipfs-level","owner":"ipfs-shipyard","description":"Leveldown over IPFS","archived":false,"fork":false,"pushed_at":"2018-03-26T16:40:57.000Z","size":12958,"stargazers_count":32,"open_issues_count":2,"forks_count":2,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-13T13:05:37.594Z","etag":null,"topics":["ipfs","leveldb","leveldown"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipfs-shipyard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-23T09:25:58.000Z","updated_at":"2024-05-30T10:40:04.000Z","dependencies_parsed_at":"2022-09-15T08:42:59.060Z","dependency_job_id":null,"html_url":"https://github.com/ipfs-shipyard/js-ipfs-level","commit_stats":null,"previous_names":["ipfs-shipyard/ipfs-level"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fjs-ipfs-level","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fjs-ipfs-level/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fjs-ipfs-level/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-shipyard%2Fjs-ipfs-level/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfs-shipyard","download_url":"https://codeload.github.com/ipfs-shipyard/js-ipfs-level/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717242,"owners_count":21150389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipfs","leveldb","leveldown"],"created_at":"2025-03-10T14:36:50.687Z","updated_at":"2025-10-16T13:16:12.218Z","avatar_url":"https://github.com/ipfs-shipyard.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipfs-level\n\n\u003e Leveldown over IPFS\n\n\n[![made by Protocol Labs](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.io)\n[![Freenode](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n\n[![Build Status](https://travis-ci.org/ipfs-shipyard/ipfs-level.svg?branch=master)](https://travis-ci.org/ipfs-shipyard/ipfs-level)\n\n# Install\n\n```bash\n$ npm install ipfs-level --save\n```\n\n# Import\n\n```js\nconst IPFSLevel = require('ipfs-level')\n```\n\n# API\n\n## IPFSLevel(partition, options)\n\nReturns a new IPFSLevel instance. This object obeys [the LevelDown interface](https://github.com/level/leveldown).\n\nArguments:\n\n* `options` (object, defaults to [this](src/default-options.js)): with the following keys:\n  * `ipfsOptions` (object). [IPFS options object](https://github.com/ipfs/js-ipfs#advanced-options-when-creating-an-ipfs-node).\n  * `log` (LevelDown-compatible database that stores the log)\n  * `ipfs` (IPFS object): an IPFS object instance. If you already can provide an IPFS object, pass it in here.\n  * `retainLog` (boolean, defaults to false`): whether or not the log should be retained. Besides wasting storage space, setting this option to `true` provides no direct benefit, except if you want to somehow explore the log database.\n\n# Default arguments\n\nYou can create a constructor that curries some default arguments by using `IPFSLevel.defaults(options)` like this:\n\n```js\nconst ipfsLevel = IPFSLevel.defaults({\n  log: someLevelDownLogDatabase\n})\n```\n\n## Events\n\nAn IPFSLevel instance emits the following events\n\n### `emit(\"started\")`\n\nWhen started.\n\n### `emit(\"change\", change)`\n\nEmitted whenever there is a change in the database. The event payload is a `change` object, which has the following properties:\n  * `type` (string: \"put\" or \"del\")\n  * `key` (string): the key affected by this change\n  * `value` (any): the new value for the mentioned key\n\n### `emit(\"new head\", cid)`\n\nWhenever the log has a new head. The payload, `cid` is a content identifier (internal to IPFS)\n\n\n## With Levelup\n\n\nThis default options feature may be useful if you want to pass a constructor into which you'll have no saying about the options, like on the Levelup constructor:\n\n```js\nconst LevelUp = require('levelup')\nconst Memdown = require('memdown') // any leveldown db will do for caching log entries\nconst IPFSLevel = require('ipfs-level').defaults({\n  log: Memdown('some-partition-name') // log database should be scoped to partition\n})\n\nconst db = LevelUp({ db: IPFSLevel })\n// now you have a levelup db you can use\n```\n\n# Test and debug\n\nThis package uses [debug](https://github.com/visionmedia/debug#readme), so you can activate debug messages by setting the environment variable `DEBUG` to `ipfs-level:*`\n\n# License\n\nMIT\n\n## Contribute\n\nFeel free to join in. All welcome. Open an [issue](https://github.com/pgte/ipfs-level/issues)!\n\nThis repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs-shipyard%2Fjs-ipfs-level","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfs-shipyard%2Fjs-ipfs-level","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs-shipyard%2Fjs-ipfs-level/lists"}