{"id":15862202,"url":"https://github.com/afeiship/next-operation-history","last_synced_at":"2026-04-28T08:32:26.104Z","repository":{"id":57122781,"uuid":"250481756","full_name":"afeiship/next-operation-history","owner":"afeiship","description":"Operation history for next.","archived":false,"fork":false,"pushed_at":"2020-11-22T06:15:09.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-19T22:26:20.116Z","etag":null,"topics":["history","next","operation","redo","undo"],"latest_commit_sha":null,"homepage":null,"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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-27T08:35:58.000Z","updated_at":"2020-11-22T06:15:11.000Z","dependencies_parsed_at":"2022-08-24T14:57:00.971Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-operation-history","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/next-operation-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-operation-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-operation-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-operation-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-operation-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-operation-history/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-operation-history/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32373498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["history","next","operation","redo","undo"],"created_at":"2024-10-05T22:25:38.549Z","updated_at":"2026-04-28T08:32:26.084Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-operation-history\n\u003e Operation history for next.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-operation-history\n```\n\n## structure\n```js\n{\n  max: 100,\n  engine: 'local', // session\n  prefix:'wbs', // wbs__operation_history@\n  index: 0,  // the pointer\n  data: [\n    { id:'obj_hash1', value: 'json1'},\n    { id:'obj_hash2', value: 'json2'},\n    { id:'obj_hash3', value: 'json3'},\n    { id:'obj_hash4', value: 'json4'},\n  ]\n}\n```\n\n\n## configuration\n```js\n{\n  max: 10,\n  engine: 'local', // session\n  prefix: 'nx'\n}\n```\n\n## methods\n| api     | params  | description                              |\n| ------- | ------- | ---------------------------------------- |\n| reset   | -       | Set index/data to default options value. |\n| last    | -       | Get last index.                          |\n| at      | -/index | Get current(index) item at index.        |\n| get     | (id)    | Get data by id.                          |\n| gets    | -       | Get all storage data.                    |\n| forward | -       | Move index to next.                      |\n| back    | -       | Move index to previous.                  |\n| go      | index   | Move to the index.                       |\n| push    | data    | Push data to items.                      |\n| replace | data    | Replace the last item.                   |\n| add     | data    | Add to the store without judgement.       |\n| del     | id      | Remove all the equal id elements.        |\n\n## properties\n| api    | description                 |\n| ------ | --------------------------- |\n| next   | Property: can forward?      |\n| prev   | Property: can back?         |\n| length | Property: data size         |\n| index  | Property: Pointer           |\n| data   | Property: the original data |\n\n## usage\n```js\nimport NxOperationHistory from '@feizheng/next-operation-history';\n\n// code goes here:\nconst noh = new NxOperationHistory({ prefix: 'abc', max: 20, engine:'local' });\n\n// save:\nnoh.push();\nnoh.at():\n\n// undo\nnoh.back();\nnoh.at();\n\n// redo\nnoh.forward();\nnoh.at();\n\n// can next?\nnoh.next\n\n// can previous?\nnoh.prev\n```\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-operation-history/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-operation-history\n[version-url]: https://npmjs.org/package/@jswork/next-operation-history\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-operation-history\n[license-url]: https://github.com/afeiship/next-operation-history/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-operation-history\n[size-url]: https://github.com/afeiship/next-operation-history/blob/master/dist/next-operation-history.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-operation-history\n[download-url]: https://www.npmjs.com/package/@jswork/next-operation-history\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-operation-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-operation-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-operation-history/lists"}