{"id":15693706,"url":"https://github.com/doowb/stash-object","last_synced_at":"2025-05-08T04:53:15.990Z","repository":{"id":57369827,"uuid":"64277955","full_name":"doowb/stash-object","owner":"doowb","description":"Stash the current state of an object and restore at a later time.","archived":false,"fork":false,"pushed_at":"2016-07-28T17:10:35.000Z","size":12,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T04:53:10.299Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.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":"2016-07-27T04:49:09.000Z","updated_at":"2021-04-12T22:02:45.000Z","dependencies_parsed_at":"2022-09-09T16:32:07.096Z","dependency_job_id":null,"html_url":"https://github.com/doowb/stash-object","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fstash-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fstash-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fstash-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fstash-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/stash-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002848,"owners_count":21838638,"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":[],"created_at":"2024-10-03T18:47:43.041Z","updated_at":"2025-05-08T04:53:15.965Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stash-object [![NPM version](https://img.shields.io/npm/v/stash-object.svg?style=flat)](https://www.npmjs.com/package/stash-object) [![NPM downloads](https://img.shields.io/npm/dm/stash-object.svg?style=flat)](https://npmjs.org/package/stash-object) [![Build Status](https://img.shields.io/travis/doowb/stash-object.svg?style=flat)](https://travis-ci.org/doowb/stash-object)\n\nStash the current state of an object and restore at a later time.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save stash-object\n```\n\n## Usage\n\n```js\nvar stash = require('stash-object');\n```\n\n## API\n\n### [stash](index.js#L22)\n\nCreate a new stash for an object. This will return an object with [.stash](#stash-1) and [.restore](#restore) methods used for stashing and restoring states of the original object.\n\n**Params**\n\n* `obj` **{Object}**: Object to use for original state.\n* `returns` **{Object}**: New instance used for stashing and restoring object state.\n\n**Example**\n\n```js\nvar options = {};\nvar optionStash = stash(options);\n```\n\n### [.stash](index.js#L49)\n\nStash the current object state on a named stack. Pass a property path as the second argument to only stash part of the object.\n\n**Params**\n\n* `name` **{String}**: Name of the stack to push the object state onto.\n* `prop` **{String|Array}**: Optional property path to stash\n* `returns` **{Object}** `this`: for chaining\n\n**Example**\n\n```js\noptionStash.stash('foo');\noptionStash.stash('foo', 'bar.baz');\n```\n\n### [.restore](index.js#L81)\n\nRestore a stashed object from the stack. Pass a property path as the second argument to only restore part of the object.\n\n**Params**\n\n* `name` **{String}**: Name of the stack to retore the object state from.\n* `prop` **{String|Array}**: Optional property path to restore\n* `returns` **{Object}**: Restored object. This is returned in case the original object reference needs to be reset.\n\n**Example**\n\n```js\nvar obj = optionsStash.restore('foo');\nvar obj = optionsStash.restore('foo', 'bar.baz');\n```\n\n## About\n\n### Related projects\n\n* [clone-deep](https://www.npmjs.com/package/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. | [homepage](https://github.com/jonschlinkert/clone-deep \"Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives.\")\n* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value \"Use property paths (`a.b.c`) to get a nested value from an object.\")\n* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value \"Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_\n\nTo generate the readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install -g verb verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](http://twitter.com/doowb)\n\n### License\n\nCopyright © 2016, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT license](https://github.com/doowb/stash-object/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 28, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fstash-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Fstash-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fstash-object/lists"}