{"id":20597120,"url":"https://github.com/tradle/feed-indexer","last_synced_at":"2026-05-26T20:32:06.735Z","repository":{"id":66294674,"uuid":"59917884","full_name":"tradle/feed-indexer","owner":"tradle","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-13T17:11:17.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T09:50:56.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tradle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-28T23:04:41.000Z","updated_at":"2018-11-13T17:11:19.000Z","dependencies_parsed_at":"2023-02-23T01:30:33.695Z","dependency_job_id":null,"html_url":"https://github.com/tradle/feed-indexer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/tradle/feed-indexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ffeed-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ffeed-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ffeed-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ffeed-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tradle","download_url":"https://codeload.github.com/tradle/feed-indexer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Ffeed-indexer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33538659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-16T08:20:21.639Z","updated_at":"2026-05-26T20:32:06.717Z","avatar_url":"https://github.com/tradle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# feed-indexer\n\nBased on [level-secondary](https://github.com/juliangruber/level-secondary) and [changes-index](https://github.com/substack/changes-index). \n\nBorrows API style from level-secondary, but unlike level-secondary, builds indexes on a feed rather than a database.\n\nBorrows some index-processing logic from changes-index, but unlike changes-index, here you write to the feed directly, and can define custom indexing rules.\n\n# Usage\n\n```js\nconst changes = require('changes-feed')\nconst levelup = require('levelup')\nconst memdown = require('memdown')\nconst collect = require('stream-collector')\nconst indexer = require('feed-indexer')\nconst level = function (path, opts) {\n  opts = opts || {}\n  if (!opts.db) opts.db = memdown\n  return levelup(path, opts)\n}\n\nconst levelOpts = { valueEncoding: 'json' }\nconst feed = changes(level('feed', levelOpts))\nconst db = level('blah', levelOpts)\nconst indexedDB = indexer({\n  primaryKey: 'id',\n  feed: feed,\n  db: db\n})\n\n// default: index by a property value\nconst byFirstName = indexedDB.by('firstName')\nconst byLastName = indexedDB.by('lastName')\n\n// custom: index by whatever\nconst byFingerprint = indexedDB.by('fingerprint', function (val) {\n  return val.keys.map(function (key) {\n    return key.fingerprint + indexedDB.separator + val.id\n  })\n})\n\nfeed.append({\n  id: 'pr',\n  firstName: 'Patrick',\n  lastName: 'Rothfuss',\n  keys: [\n    { fingerprint: 'abc' },\n    { fingerprint: 'def' },\n  ]\n})\n\nfeed.append({\n  id: 'ja',\n  firstName: 'Joe',\n  lastName: 'Abercrombie',\n  keys: [\n    { fingerprint: 'ghi' },\n    { fingerprint: 'jkl' },\n  ]\n})\n\nfeed.append({\n  id: 'ey',\n  firstName: 'Eliezer',\n  lastName: 'Yudkowsky',\n  keys: [\n    { fingerprint: 'mno' },\n    { fingerprint: 'pqr' },\n  ]\n})\n\ncollect(byFirstName.createReadStream({ gte: 'Joe' }), function (err, results) {\n  console.log('by first name \u003e= Joe:')\n  console.log(results)\n  console.log()\n\n  byFingerprint.findOne({ lt: 'fgh' }, function (err, result) {\n    console.log('first by fingerprint \u003c fgh:')\n    console.log(result)\n    console.log()\n\n    byLastName.findOne('Yudkowsky', function (err, result) {\n      console.log('by lastName === \"Yudkowsky\":')\n      console.log(result)\n      console.log()\n    })\n  })\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Ffeed-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftradle%2Ffeed-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Ffeed-indexer/lists"}