{"id":18840134,"url":"https://github.com/openupm/verdaccio-redis-storage","last_synced_at":"2025-04-14T07:06:09.538Z","repository":{"id":38174683,"uuid":"276448090","full_name":"openupm/verdaccio-redis-storage","owner":"openupm","description":"A Redis based storage plugin for Verdaccio.","archived":false,"fork":false,"pushed_at":"2023-10-24T18:07:25.000Z","size":2176,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T07:04:18.117Z","etag":null,"topics":["hacktoberfest","redis","verdaccio","verdaccio-plugin","verdaccio-redis-storage"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openupm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"patreon":"openupm"}},"created_at":"2020-07-01T17:59:29.000Z","updated_at":"2024-10-19T18:02:59.000Z","dependencies_parsed_at":"2024-11-08T02:45:15.404Z","dependency_job_id":null,"html_url":"https://github.com/openupm/verdaccio-redis-storage","commit_stats":{"total_commits":91,"total_committers":4,"mean_commits":22.75,"dds":"0.46153846153846156","last_synced_commit":"92aee62f72361e251831d7b8bf1e6fc5d6d4c5da"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openupm%2Fverdaccio-redis-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openupm%2Fverdaccio-redis-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openupm%2Fverdaccio-redis-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openupm%2Fverdaccio-redis-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openupm","download_url":"https://codeload.github.com/openupm/verdaccio-redis-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837280,"owners_count":21169374,"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":["hacktoberfest","redis","verdaccio","verdaccio-plugin","verdaccio-redis-storage"],"created_at":"2024-11-08T02:45:10.375Z","updated_at":"2025-04-14T07:06:08.997Z","avatar_url":"https://github.com/openupm.png","language":"TypeScript","funding_links":["https://patreon.com/openupm"],"categories":[],"sub_categories":[],"readme":"# verdaccio-redis-storage\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n![npm](https://img.shields.io/npm/v/verdaccio-redis-storage) ![NPM](https://img.shields.io/npm/l/verdaccio-redis-storage) ![npm](https://img.shields.io/npm/dm/verdaccio-redis-storage)\n\nA Redis based storage plugin for Verdaccio.\n\n## Usage\n\nInstall\n\n```bash\nnpm install verdaccio-redis-storage\n```\n\nConfiguration\n\n```yaml\nstore:\n  redis-storage:\n    host: 127.0.0.1\n    port: 6379\n    ...\n```\n\nSee more in https://github.com/luin/ioredis#connect-to-redis\n\n\u003e **Note**\n\u003e Since v0.2.5, verdaccio-redis-storage changed the redis library from node-redis to [ioredis](https://github.com/luin/ioredis).\n\n### About the offline queue\n\nBy default, there is no active connection to the Redis server, commands are added to a queue and are executed once the connection is \"ready\". This is (only) necessary for the verdaccio-redis-storage initialziation, due to the way a verdaccio plugin is being invoked. You should not set the enableOfflineQueue boolean to false in the configuration file.\n\nHowever, the offline queue feature will be disabled when the first redis connection is ready, to make following web requests fail instantly if a redis connection is down.\n\n## Serving tarball\n\nRedis is an in-memory database that is not good at dealing with large tarball files. It's highly recommended to use [verdaccio-storage-proxy](https://github.com/openupm/verdaccio-storage-proxy) to decouple the tarball accesses to another storage backend like [verdaccio-aws-s3-storage](https://github.com/verdaccio/monorepo/tree/master/plugins/aws-s3-storage) or [verdaccio-minio](https://github.com/barolab/verdaccio-minio).\n\n## Data structure\n\n| Content type | Redis type | Redis key           | Hash field   | Note           |\n|--------------|------------|---------------------|--------------|----------------|\n| package list | set        | ve:pkgs             | -            |                |\n| secret       | string     | ve:secret           | -            |                |\n| token        | hash       | ve:token:$user      | $tokenKey    |                |\n| package.json | hash       | ve:pkg:$packageName | package.json |                |\n| tarball      | hash       | ve:pkg:$packageName | $fileName    | base64 encoded |\n\nData are stored with prefix `ve:` (`testve:` for test mode).\n\n## Dump and restore\n\nWith verdaccio-redis CLI, you can exchange data between redis storage and file system.\n\n\u003e Dump and restore commmands don't support token yet.\n\nGoto the package folder where you installed the plugin, run `./node_modules/verdaccio-redis-storage/bin/verdaccio-redis`.\n\n```sh\n$ ./node_modules/verdaccio-redis-storage/bin/verdaccio-redis --help\nUsage: verdaccio-redis [options] [command]\n\nverdaccio-redis-storage CLI\n\nOptions:\n  -V, --version            output the version number\n  --config \u003cpath\u003e          specify the path of Verdaccio configuration file\n  --host \u003chost\u003e            Redis host\n  --port \u003cport\u003e            Redis port\n  --url \u003curl\u003e              Redis URL string\n  --socket \u003csocket\u003e        Redis socket string\n  --password \u003cpassword\u003e    Redis password\n  --db \u003cdb\u003e                Redis db\n  --prefix \u003cprefix\u003e        Redis prefix\n  -h, --help               display help for command\n\nCommands:\n  dump [options] \u003cdir\u003e     dump Redis storage to dir\n  restore [options] \u003cdir\u003e  restore Redis storage from dir\n  help [command]           display help for command\n```\n\nYou can provide the Redis connection by specifying the Verdaccio config path (`--config=...`), or extra options like `--host` and `--port`. By default, it connects to `127.0.0.1:6379`.\n\n### Dump redis storage to file system\n\nUse the dump command to export redis storage to the file system. The exported folder can be used by Verdaccio's default file storage.\n\n```sh\n$ ./node_modules/verdaccio-redis-storage/bin/verdaccio-redis dump --help\nUsage: verdaccio-redis dump [options] \u003cdir\u003e\n\ndump Redis storage to dir\n\nOptions:\n  --no-tarball  ignore tarball files\n  --dbname      database filename (default: .verdaccio-db.json)\n  -h, --help    display help for command\n```\n\nUse `--no-tarball` option to ignore export tarball files to the file system. See [serving tarball](#serving-tarball) for details.\n\nUse `--dbname` option to specify a different database filename to write. i.e. for Verdaccio S3 storage, the filename is `verdaccio-s3-db.json`.\n\n### Restore redis storage from file system\n\nUse the restore command to import redis storage from the file system.\n\n```sh\n./node_modules/verdaccio-redis-storage/bin/verdaccio-redis restore --help\nUsage: verdaccio-redis restore [options] \u003cdir\u003e\n\nrestore Redis storage from dir\n\nOptions:\n  --no-tarball  ignore tarball files\n  --dbname      database filename (default: .verdaccio-db.json)\n  --scan        scan package.json to fill database\n  -h, --help    display help for command\n```\n\nUse `--no-tarball` option to ignore import tarball files to the Redis storage. See [serving tarball](#serving-tarball) for details.\n\nUse `--dbname` option to specify a different database filename to read. i.e. for Verdaccio S3 storage, the filename is `verdaccio-s3-db.json`.\n\nUse `--scan` option to scan the `package.json` file of sub-folders to fill the database. A rare usage to convert cached uplink packages to local packages (uplink packages are not stored to database by defaut).\n\n## Development\n\nSee the [verdaccio contributing guide](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.\nOnce you have completed that, use the following npm tasks.\n\n  - `npm run build`\n\n    Build a distributable archive\n\n  - `npm run test`\n\n    Run unit test\n\nFor more information about any of these commands run `npm run ${task} -- --help`.\n\n## Reference\n\n- [generator-verdaccio-plugin](https://github.com/verdaccio/generator-verdaccio-plugin), verdaccio plugin generator based in [Yeoman](http://yeoman.io/) aims to help to scaffold plugins development.\n- [verdaccio-minio](https://github.com/barolab/verdaccio-minio), a good example of verdaccio storage plugin.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://littlebigfun.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/125390?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFavo Yang\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/openupm/verdaccio-redis-storage/commits?author=favoyang\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenupm%2Fverdaccio-redis-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenupm%2Fverdaccio-redis-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenupm%2Fverdaccio-redis-storage/lists"}