{"id":18385251,"url":"https://github.com/wankdanker/node-redis-jsonify","last_synced_at":"2025-07-02T09:05:52.749Z","repository":{"id":3904208,"uuid":"4992617","full_name":"wankdanker/node-redis-jsonify","owner":"wankdanker","description":"Save JSON representation of objects to redis when using node_redis","archived":false,"fork":false,"pushed_at":"2018-04-18T15:31:30.000Z","size":14,"stargazers_count":58,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-09T07:55:57.746Z","etag":null,"topics":["json","nodejs","redis"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/wankdanker.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":"2012-07-11T17:35:54.000Z","updated_at":"2022-07-06T06:46:18.000Z","dependencies_parsed_at":"2022-07-12T23:10:34.480Z","dependency_job_id":null,"html_url":"https://github.com/wankdanker/node-redis-jsonify","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/wankdanker/node-redis-jsonify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-redis-jsonify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-redis-jsonify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-redis-jsonify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-redis-jsonify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wankdanker","download_url":"https://codeload.github.com/wankdanker/node-redis-jsonify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-redis-jsonify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260897044,"owners_count":23079171,"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":["json","nodejs","redis"],"created_at":"2024-11-06T01:17:03.420Z","updated_at":"2025-07-02T09:05:52.729Z","avatar_url":"https://github.com/wankdanker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-redis-jsonify\n==================\n\n[![Build Status](https://travis-ci.org/wankdanker/node-redis-jsonify.svg?branch=master)](https://travis-ci.org/wankdanker/node-redis-jsonify)\n\nSave JSON representation of objects to redis when using node_redis\n\nwhy\n------\n\nI basically always save JSON objects to redis. As far as I can tell there isn't \na way to make @mranney's [node_redis](https://github.com/mranney/node_redis) \nimplicitly convert objects and arrays to JSON before they are sent off to redis.\nSo I would always to have to wrap my set and get calls with JSON.parse/stringify\nnonsense. \n\nhow\n------\n\nThis module exports a function which when passed a RedisClient instance will \nproxy the send_command method and convert anything that is not a Buffer to and \nfrom JSON. I considered modifying the RedisClient prototype automatically when \nthis module is included in your project, but decided against it because you may\nnot want this behavior on all of your redis clients.\n\ncompatibility\n-------------\n\nThis module is compatible with most versions of node_redis from 0.6.7 to 2.8.0\nexcept 2.4.2 and 2.3.1.\n\ninstall\n---------\n\nwith npm...\n\n```bash\nnpm install redis-jsonify\n```\n\nor with git...\n\n```bash\ngit clone git://github.com/wankdanker/node-redis-jsonify.git\n```\n\nexample\n------------\n\n```javascript\n\nvar redis = require('redis')\n\t, jsonify = require('redis-jsonify')\n\t, client = jsonify(redis.createClient())\n\t;\n\nclient.set('asdf', { foo : \"bar\" }, function (err, result) {\n\t\tclient.get('asdf', function (err, result) {\n\t\t\tconsole.log(result); \n\t\t\t// should be { foo : \"bar\" } and not [Object object]\n\t\t\t\n\t\t\tclient.quit(function () {\t});\n\t\t});\n});\n\n```\n\nextras\n--------\n\nI'm not a huge redis buff yet, so there may be certain commands for which this \nis not a good idea. One example would be the `list` command. The value returned\nby the `list` command is not JSON. To disable the JSON processing for certain\ncommands there is a command blacklist array exported by the module. It currently\nonly contains the `list` command. If you know of other commands that should be\nblacklisted by default or there should be special processing, let me know and\nI'll add them. Pull requests welcome also.\n\n```javascript\nvar jsonify = require('redis-jsonify');\n\n//add somecommand to the blacklist\njsonify.blacklist.push('somecommand');\n\n//dump the blacklist to console\nconsole.log(jsonify.blacklist);\n```\n\nlicense\n----------\n\n### The MIT License (MIT)\n\n\nCopyright (c) 2012 Daniel L. VerWeire\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwankdanker%2Fnode-redis-jsonify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwankdanker%2Fnode-redis-jsonify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwankdanker%2Fnode-redis-jsonify/lists"}