{"id":15064429,"url":"https://github.com/alanchenchen/svelte-store-persisted","last_synced_at":"2026-02-24T10:04:35.268Z","repository":{"id":57096101,"uuid":"233822532","full_name":"alanchenchen/svelte-store-persisted","owner":"alanchenchen","description":"persisted plugin for svelte store manager","archived":false,"fork":false,"pushed_at":"2020-01-19T09:48:51.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-24T07:36:56.960Z","etag":null,"topics":["localstorage","persistedstate","session-store","svelte-store","svelte3"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanchenchen.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":"2020-01-14T11:06:26.000Z","updated_at":"2021-11-18T15:50:33.000Z","dependencies_parsed_at":"2022-08-22T21:40:44.777Z","dependency_job_id":null,"html_url":"https://github.com/alanchenchen/svelte-store-persisted","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alanchenchen/svelte-store-persisted","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanchenchen%2Fsvelte-store-persisted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanchenchen%2Fsvelte-store-persisted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanchenchen%2Fsvelte-store-persisted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanchenchen%2Fsvelte-store-persisted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanchenchen","download_url":"https://codeload.github.com/alanchenchen/svelte-store-persisted/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanchenchen%2Fsvelte-store-persisted/sbom","scorecard":{"id":177373,"data":{"date":"2025-08-11","repo":{"name":"github.com/alanchenchen/svelte-store-persisted","commit":"23f50e18d29643988f020a742096875fd3ad652a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T18:00:04.438Z","repository_id":57096101,"created_at":"2025-08-16T18:00:04.438Z","updated_at":"2025-08-16T18:00:04.438Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29779262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"last_error":"SSL_read: 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":["localstorage","persistedstate","session-store","svelte-store","svelte3"],"created_at":"2024-09-25T00:18:20.595Z","updated_at":"2026-02-24T10:04:35.255Z","avatar_url":"https://github.com/alanchenchen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-store-persisted\n![](https://img.shields.io/npm/v/@alanchenchen/svelte-store-persisted.svg)\n![](https://img.shields.io/npm/dt/@alanchenchen/svelte-store-persisted.svg)\n[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)\n\nA persisted plugin for svelte store manager\n\u003e 基于svelte store manager开发的将state状态持久化的插件\n\n\u003e Author：Alan Chen\n\n\u003e Version: 0.1.1\n\n\u003e Date: 2020/1/19\n\n## features\n1. 自动同步state到浏览器本地存储，初始化同步一次，在每次commit都会更新。\n2. 本地存储默认是window.localStorage，可选window.sessionStorage。\n3. 由于和mutaion绑定，所以只支持同步操作的本地存储，而不支持web IndexDB。\n4. 本插件支持store单独调用，也支持全局调用，当全局调用时，store必须提供模块的name。\n5. 支持存储指定store的指定数据。\n\n## installation\n`npm install --save-dev @alanchenchen/svelte-store-persisted` or `yarn add @alanchenchen/svelte-store-persisted --dev`\n\n## usage\n```js\n// 全局使用\nimport { useGlobalPlugins } from \"@alanchenchen/svelte-store\";\nimport persisted from \"@alanchenchen/svelte-store-persisted\";\n\nuseGlobalPlugins([\n    persisted({\n        // 只会存储所有store的name字段，过滤age字段.\n        paths: [\"name\"]\n        filter: (storeName) =\u003e {\n            // moduleA不会应用此插件.\n            if (storeName === \"A\") {\n                return false\n            } else {\n                return true;\n            }\n        }\n    })\n]);\n```\n\n```js\n// 分模块使用\n// a.js\nimport { createStore } from \"@alanchenchen/svelte-store\";\nimport persisted from \"@alanchenchen/svelte-store-persisted\";\n\nconst a = createStore({name: \"A\", age: 21}, \"moduleA\");\na.use(persisted());\n// b.js\nimport { createStore } from \"@alanchenchen/svelte-store\";\nimport persisted from \"@alanchenchen/svelte-store-persisted\";\n\nconst b = createStore({name: \"B\", age: 22}, \"moduleB\");\nb.use(persisted());\n```\n\n## options\npersisted的参数是个对象，格式如下：\n* key - storage存储的key值，默认svelte-store，当全局使用时，会取store实例的name属性，全局使用必须要补全store实例的name。\n* paths - store实例存储在storage里的数据路径，由store实例初始值的key的数组，默认空数组，全部的属性都会存储。\n* filter - 过滤某些不需要存储的情况，回调函数，返回值为true的数据才会被存储，参数如下：\n    * storeName - 应用此插件的store实例名称，当全局使用时，可以过滤某些store不被存储\n    * type - mutation的类型\n* storage - storage的类型，默认window.localStorage，可选window.sessionStorage。\n\n## build\n1. `git clone https://github.com/alanchenchen/svelte-store-persisted.git`\n2. 然后`yarn`安装好依赖\n3. 接着使用下面的脚本命令即可，目前入口文件是src/index.ts\n\n## scripts\n1. `npm run build`编译ts文件到dist目录.\n\n## license\n* Anti 996(996.ICU)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanchenchen%2Fsvelte-store-persisted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanchenchen%2Fsvelte-store-persisted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanchenchen%2Fsvelte-store-persisted/lists"}