{"_id":"@iovalkey/commands","name":"@iovalkey/commands","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@iovalkey/commands","version":"0.1.0","description":"Valkey commands","main":"dist/index.js","scripts":{"pretest":"npm run build && npm run lint","test":"mocha","lint":"eslint .","build":"rm -rf built && tsc","gen":"node tools/build"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/iovalkey/commands.git"},"keywords":["redis","commands","prefix"],"author":{"name":"Zihua Li","email":"i@zihua.li","url":"http://zihua.li"},"license":"MIT","bugs":{"url":"https://github.com/iovalkey/commands/issues"},"homepage":"https://github.com/iovalkey/commands","devDependencies":{"@types/node":"^22.10.9","chai":"^4.0.0","eslint":"^9.18.0","iovalkey":"^0.2.2","mocha":"^11.1.0","neostandard":"^0.12.0","safe-stable-stringify":"^2.5.0","typescript":"^5.0.0"},"_id":"@iovalkey/commands@0.1.0","gitHead":"76d94ff66d99c24416b3aea13360c8c5c857919e","types":"./dist/index.d.ts","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-/B9W4qKSSITDii5nkBCHyPkIkAi+ealUtr1oqBJsLxjSRLka4pxun2VvMNSmcwgAMxgXtQfl0qRv7TE+udPJzg==","shasum":"62648b19106690ee8ce7d11aaf6249a242f927b0","tarball":"https://registry.npmjs.org/@iovalkey/commands/-/commands-0.1.0.tgz","fileCount":6,"unpackedSize":55560,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDAdDuyOnNtdRRKYMLjpgx0atwNtZKxcoH/m2n2ZklQsQIhAMJCcN0TTHEURjehS1pbHyQrlJ+jYTJMGyBljZ/MXbDV"}]},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commands_0.1.0_1737630767570_0.19212792431290815"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-23T11:12:47.488Z","0.1.0":"2025-01-23T11:12:47.738Z","modified":"2025-01-23T11:12:48.008Z"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"description":"Valkey commands","homepage":"https://github.com/iovalkey/commands","keywords":["redis","commands","prefix"],"repository":{"type":"git","url":"git+https://github.com/iovalkey/commands.git"},"author":{"name":"Zihua Li","email":"i@zihua.li","url":"http://zihua.li"},"bugs":{"url":"https://github.com/iovalkey/commands/issues"},"license":"MIT","readme":"# Valkey Commands\n\nThis module exports all the commands that Valkey supports.\n\nThis module was forked from [`@ioredis/commands`](https://github.com/ioredis/commands) at commit 4321d5d40473c48fadf49fd99662032eac9b855b\n\n## Install\n\n```shell\n$ npm install @iovalkey/commands\n```\n\n## Usage\n\n```js\nconst commands = require('@iovalkey/commands');\n```\n\n`.list` is an array contains all the lowercased commands:\n\n```js\ncommands.list.forEach((command) => {\n  console.log(command);\n});\n```\n\n`.exists()` is used to check if the command exists:\n\n```js\ncommands.exists('set') // true\ncommands.exists('other-command') // false\n```\n\n`.hasFlag()` is used to check if the command has the flag:\n\n```js\ncommands.hasFlag('set', 'readonly') // false\n```\n\n`.getKeyIndexes()` is used to get the indexes of keys in the command arguments:\n\n```js\ncommands.getKeyIndexes('set', ['key', 'value']) // [0]\ncommands.getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}