[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3365":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":18,"lastSyncTime":35,"discoverSource":36},3365,"store.js","marcuswestin\u002Fstore.js","marcuswestin","Cross-browser storage for all use cases, used across the web.","",null,"JavaScript",13984,1301,345,69,0,1,2,70.04,"MIT License",false,"master",true,[25,26,27,28,29,30,31],"cross-browser","javascript","localstorage","plugins","serialization","storage","store-json","2026-06-12 04:00:17","Store.js\n========\n\nCross-browser storage for all use cases, used across the web.\n\n[![Circle CI](https:\u002F\u002Fimg.shields.io\u002Fcircleci\u002Fproject\u002Fgithub\u002Fmarcuswestin\u002Fstore.js.svg)](https:\u002F\u002Fcircleci.com\u002Fgh\u002Fmarcuswestin\u002Fstore.js)\n[![npm version](https:\u002F\u002Fbadge.fury.io\u002Fjs\u002Fstore.svg)](https:\u002F\u002Fbadge.fury.io\u002Fjs\u002Fstore)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fstore.svg?maxAge=2592000)](https:\u002F\u002Fnpm-stat.com\u002Fcharts.html?package=store)\n\nStore.js has been around since 2010 ([first commit](https:\u002F\u002Fgithub.com\u002Fmarcuswestin\u002Fstore.js\u002Fcommit\u002Fcb0198c2c02ff5f17c084276eeb4f28c79849d5e), [v1 release](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=1468802)). It is used in production on tens of thousands of websites, such as cnn.com, dailymotion.com, & many more.\n\nStore.js provides basic key\u002Fvalue storage functionality (`get\u002Fset\u002Fremove\u002Feach`) as well as a rich set of plug-in [storages](#user-content-storages) and extra [functionality](#user-content-plugins).\n\n\n1. [Basic Usage](#user-content-basic-usage)\n\t- All you need to get started\n\t- [API](#user-content-api)\n\t- [Installation](#user-content-installation)\n2. [Supported Browsers](#user-content-supported-browsers)\n\t- All of them, pretty much :)\n\t- [List of supported browsers](#user-content-list-of-supported-browsers)\n3. [Plugins](#user-content-plugins)\n\t- Additional common functionality\n\t- [List of all Plugins](#user-content-list-of-all-plugins)\n\t- [Using Plugins](#user-content-using-plugins)\n\t- [Write your own Plugin](#user-content-write-your-own-plugin)\n4. [Builds](#user-content-builds)\n\t- Choose which build is right for you\n\t- [List of default Builds](#user-content-list-of-default-builds)\n\t- [Make your own Build](#user-content-make-your-own-build)\n5. [Storages](#user-content-storages)\n\t- Storages provide underlying persistence\n\t- [List of all Storages](#user-content-list-of-all-storages)\n\t- [Storages limits](#user-content-storages-limits)\n\t- [Write your own Storage](#user-content-write-your-own-storage)\n\n\nBasic Usage\n-----------\n\nAll you need to know to get started:\n\n### API\n\nstore.js exposes a simple API for cross-browser local storage:\n\n```js\n\u002F\u002F Store current user\nstore.set('user', { name:'Marcus' })\n\n\u002F\u002F Get current user\nstore.get('user')\n\n\u002F\u002F Remove current user\nstore.remove('user')\n\n\u002F\u002F Clear all keys\nstore.clearAll()\n\n\u002F\u002F Loop over all stored values\nstore.each(function(value, key) {\n\tconsole.log(key, '==', value)\n})\n```\n\n### Installation\n\nUsing npm:\n\n```sh\nnpm i store\n```\n\n```js\n\u002F\u002F Example store.js usage with npm\nvar store = require('store')\nstore.set('user', { name:'Marcus' })\nstore.get('user').name == 'Marcus'\n```\n\nUsing script tag (first download one of the [builds](dist\u002F)):\n\n```html\n\u003C!-- Example store.js usage with script tag -->\n\u003Cscript src=\"path\u002Fto\u002Fmy\u002Fstore.legacy.min.js\">\u003C\u002Fscript>\n\u003Cscript>\nstore.set('user', { name:'Marcus' })\nstore.get('user').name == 'Marcus'\n\u003C\u002Fscript>\n```\n\n\n\nSupported Browsers\n------------------\n\nAll of them, pretty much :)\n\nTo support all browsers (including IE 6, IE 7, Firefox 4, etc.), use `require('store')` (alias for `require('store\u002Fdist\u002Fstore.legacy')`) or [store.legacy.min.js](dist\u002Fstore.legacy.min.js).\n\nTo save some kilobytes but still support all modern browsers, use `require('store\u002Fdist\u002Fstore.modern')` or [store.modern.min.js](dist\u002Fstore.modern.min.js) instead.\n\n### List of supported browsers\n\n- Tested on IE6+\n- Tested on iOS 8+\n- Tested on Android 4+\n- Tested on Firefox 4+\n- Tested on Chrome 27+\n- Tested on Safari 5+\n- Tested on Opera 11+\n- Tested on Node (with https:\u002F\u002Fgithub.com\u002Fcoolaj86\u002Fnode-localStorage)\n\n\n\n\nPlugins\n-------\n\nPlugins provide additional common functionality that some users might need:\n\n### List of all Plugins\n\n- [all.js](plugins\u002Fall.js):                      All the plugins in one handy place.\n- [defaults.js](plugins\u002Fdefaults.js):            Declare default values. [Example usage](plugins\u002Fdefaults_test.js)\n- [dump.js](plugins\u002Fdump.js):                    Dump all stored values. [Example usage](plugins\u002Fdump_test.js)\n- [events.js](plugins\u002Fevents.js):                Get notified when stored values change. [Example usage](plugins\u002Fevents_test.js)\n- [expire.js](plugins\u002Fexpire.js):                Expire stored values at a given time. [Example usage](plugins\u002Fexpire_test.js)\n- [observe.js](plugins\u002Fobserve.js):              Observe stored values and their changes. [Example usage](plugins\u002Fobserve_test.js)\n- [operations.js](plugins\u002Foperations.js):        Useful operations like push, shift & assign. [Example usage](plugins\u002Foperations_test.js)\n- [update.js](plugins\u002Fupdate.js):                Update a stored object, or create it if null. [Example usage](plugins\u002Fupdate_test.js)\n- [v1-backcompat.js](plugins\u002Fv1-backcompat.js):  Full backwards compatibility with store.js v1. [Example usage](plugins\u002Fv1-backcompat_test.js)\n\n### Using Plugins\n\nWith npm:\n\n```js\n\u002F\u002F Example plugin usage:\nvar expirePlugin = require('store\u002Fplugins\u002Fexpire')\nstore.addPlugin(expirePlugin)\n```\n\nIf you're using script tags, you can either use [store.everything.min.js](dist\u002Fstore.everything.min.js) (which\nhas all plugins built-in), or clone this repo to add or modify a build and run `make build`.\n\n### Write your own plugin\n\nA store.js plugin is a function that returns an object that gets added to the store.\nIf any of the plugin functions overrides existing functions, the plugin function can still call\nthe original function using the first argument (super_fn).\n\n```js\n\u002F\u002F Example plugin that stores a version history of every value\nvar versionHistoryPlugin = function() {\n\tvar historyStore = this.namespace('history')\n\treturn {\n\t\tset: function(super_fn, key, value) {\n\t\t\tvar history = historyStore.get(key) || []\n\t\t\thistory.push(value)\n\t\t\thistoryStore.set(key, history)\n\t\t\treturn super_fn()\n\t\t},\n\t\tgetHistory: function(key) {\n\t\t\treturn historyStore.get(key)\n\t\t}\n\t}\n}\nstore.addPlugin(versionHistoryPlugin)\nstore.set('foo', 'bar 1')\nstore.set('foo', 'bar 2')\nstore.getHistory('foo') == ['bar 1', 'bar 2']\n```\n\nLet me know if you need more info on writing plugins. For the moment I recommend\ntaking a look at the [current plugins](plugins\u002F). Good example plugins are\n[plugins\u002Fdefaults](plugins\u002Fdefaults.js), [plugins\u002Fexpire](plugins\u002Fexpire.js) and\n[plugins\u002Fevents](plugins\u002Fevents.js).\n\n\n\nBuilds\n------\n\nChoose which build is right for you!\n\n### List of default builds\n\n- [store.everything.min.js](dist\u002Fstore.everything.min.js): All the plugins, all the storages. [Source](dist\u002Fstore.everything.js)\n- [store.legacy.min.js](dist\u002Fstore.legacy.min.js): Full support for all tested browsers. Add plugins separately. [Source](dist\u002Fstore.legacy.js)\n- [store.modern.min.js](dist\u002Fstore.modern.min.js): Full support for all modern browsers. Add plugins separately. [Source](dist\u002Fstore.modern.js)\n- [store.v1-backcompat.min.js](dist\u002Fstore.v1-backcompat.min.js): Full backwards compatibility with [store.js v1](https:\u002F\u002Fgithub.com\u002Fmarcuswestin\u002Fstore.js\u002Freleases\u002Ftag\u002Fv1.3.20). [Source](dist\u002Fstore.v1-backcompat.js)\n\n### Make your own Build\n\nIf you're using npm you can create your own build:\n\n```js\n\u002F\u002F Example custom build usage:\nvar engine = require('store\u002Fsrc\u002Fstore-engine')\nvar storages = [\n\trequire('store\u002Fstorages\u002FlocalStorage'),\n\trequire('store\u002Fstorages\u002FcookieStorage')\n]\nvar plugins = [\n\trequire('store\u002Fplugins\u002Fdefaults'),\n\trequire('store\u002Fplugins\u002Fexpire')\n]\nvar store = engine.createStore(storages, plugins)\nstore.set('foo', 'bar', new Date().getTime() + 3000) \u002F\u002F Using expire plugin to expire in 3 seconds\n```\n\n\n\n\nStorages\n--------\nStore.js will pick the best available storage, and automatically falls back to the first available storage that works:\n\n### List of all Storages\n\n- [all.js](storages\u002Fall.js)                                     All the storages in one handy place.\n- [localStorage.js](storages\u002FlocalStorage.js)                   Store values in localStorage. Great for all modern browsers.\n- [sessionStorage.js](storages\u002FsessionStorage.js)               Store values in sessionStorage.\n- [cookieStorage.js](storages\u002FcookieStorage.js)                 Store values in cookies. Useful for Safari Private mode.\n- [memoryStorage.js](storages\u002FmemoryStorage.js)                 Store values in memory. Great fallback to ensure store functionality at all times.\n- [oldFF-globalStorage.js](storages\u002FoldFF-globalStorage.js)     Store values in globalStorage. Only useful for legacy Firefox 3+.\n- [oldIE-userDataStorage.js](storages\u002FoldIE-userDataStorage.js) Store values in userData. Only useful for legacy IE 6+.\n\n\n### Storages limits\n\nEach storage has different limits, restrictions and overflow behavior on different browser. For example, Android has has a 4.57M localStorage limit in 4.0, a 2.49M limit in 4.1, and a 4.98M limit in 4.2... Yeah.\n\nTo simplify things we provide these recommendations to ensure cross browser behavior:\n\n| Storage         | Targets                | Recommendations                 | More info                                        |\n|:----------------|:-----------------------|:--------------------------------|:-------------------------------------------------|\n| all             | All browsers           | Store \u003C 1 million characters    | (Except Safari Private mode)                     |\n| all             | All & Private mode     | Store \u003C 32 thousand characters  | (Including Safari Private mode)                  |\n| localStorage    | Modern browsers        | Max 2mb  (~1M chars)            | [limits][local-limits], [android][local-android] |\n| sessionStorage  | Modern browsers        | Max 5mb  (~2M chars)            | [limits][session-limits]                         |\n| cookieStorage   | Safari Private mode    | Max 4kb  (~2K chars)            | [limits][cookie-limits]                          |\n| userDataStorage | IE5, IE6 & IE7         | Max 64kb (~32K chars)           | [limits][userdata-limits]                        |\n| globalStorage   | Firefox 2-5            | Max 5mb  (~2M chars)            | [limits][global-limits]                          |\n| memoryStorage   | All browsers, fallback | Does not persist across pages!  |                                                  |\n\n[local-limits]: https:\u002F\u002Farty.name\u002Flocalstorage.html\n[local-android]: http:\u002F\u002Fdev-test.nemikor.com\u002Fweb-storage\u002Fsupport-test\u002F\n[session-limits]: http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002F15840976\u002Fhow-large-is-html5-session-storage\n[cookie-limits]: http:\u002F\u002Fbrowsercookielimits.squawky.net\u002F\n[userdata-limits]: https:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fms533015(v=vs.85).aspx\n[global-limits]: https:\u002F\u002Fgithub.com\u002Fjeremydurham\u002Fpersist-js\u002Fblob\u002Fmaster\u002FREADME.md#4-size-limits\n[more]: https:\u002F\u002Fwww.html5rocks.com\u002Fen\u002Ftutorials\u002Foffline\u002Fquota-research\u002F\n\n\n### Write your own Storage\n\nChances are you won't ever need another storage. But if you do...\n\nSee [storages\u002F](storages\u002F) for examples. Two good examples are [memoryStorage](storages\u002FmemoryStorage.js) and [localStorage](storages\u002FlocalStorage.js).\n\nBasically, you just need an object that looks like this:\n\n```js\n\u002F\u002F Example custom storage\nvar storage = {\n\tname: 'myStorage',\n\tread: function(key) { ... },\n\twrite: function(key, value) { ... },\n\teach: function(fn) { ... },\n\tremove: function(key) { ... },\n\tclearAll: function() { ... }\n}\nvar store = require('store').createStore(storage)\n```\n","Store.js 是一个跨浏览器的存储解决方案，适用于各种Web应用场景。它提供了基础的键值对存储功能（如get、set、remove等），并支持丰富的插件和存储选项，以满足不同的需求。该库能够自动选择最佳的存储方式（如localStorage、sessionStorage或cookie），确保在所有主流浏览器上都能正常工作，包括一些较旧的版本如IE 6\u002F7。此外，Store.js还具备序列化能力，可以直接存储对象而无需手动转换为字符串。此项目非常适合需要在客户端持久化数据但又希望保持代码简洁性和兼容性的Web开发场景。","2026-06-11 02:53:51","top_language"]