{"id":21405345,"url":"https://github.com/karimsa/kinvey-local","last_synced_at":"2025-07-29T02:07:00.023Z","repository":{"id":18838108,"uuid":"22053820","full_name":"karimsa/kinvey-local","owner":"karimsa","description":"Tool to mock the Kinvey environment for testing.","archived":false,"fork":false,"pushed_at":"2015-01-28T04:54:11.000Z","size":215,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-24T15:38:17.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karimsa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-21T06:15:25.000Z","updated_at":"2015-08-14T07:21:22.000Z","dependencies_parsed_at":"2022-08-19T21:21:48.995Z","dependency_job_id":null,"html_url":"https://github.com/karimsa/kinvey-local","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/karimsa/kinvey-local","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fkinvey-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fkinvey-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fkinvey-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fkinvey-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karimsa","download_url":"https://codeload.github.com/karimsa/kinvey-local/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fkinvey-local/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267617643,"owners_count":24116208,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-22T16:24:20.070Z","updated_at":"2025-07-29T02:06:59.979Z","avatar_url":"https://github.com/karimsa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kinvey-local [![Build Status](http://img.shields.io/travis/karimsa/kinvey-local.svg?style=flat)](https://travis-ci.org/karimsa/kinvey-local) [![View on NPM](http://img.shields.io/npm/dm/kinvey-local.svg?style=flat)](http://npmjs.org/package/kinvey-local) [![code climate](http://img.shields.io/codeclimate/github/karimsa/kinvey-local.svg?style=flat)](https://codeclimate.com/github/karimsa/kinvey-local) [![code coverage](http://img.shields.io/codeclimate/coverage/github/karimsa/kinvey-local.svg?style=flat)](https://codeclimate.com/github/karimsa/kinvey-local)\n\nTool to mock the [Kinvey](http://kinvey.com/) environment for testing.\n\n[![NPM](https://nodei.co/npm/kinvey-local.png)](https://nodei.co/npm/kinvey-local/)\n\n## Installation\n\nInstall the latest version of this package with npm:\n\n```\n$ npm install kinvey-local\n```\n\n## Usage\n\nThis package can simply replace your regular Kinvey import. For example:\n\n```javascript\n// with regular kinvey object\nvar Kinvey = require('kinvey');\n\nKinvey.User.login('username', 'password', {\n    success: function () {\n        console.log('Success.');\n    }\n});\n```\n\n```javascript\n// inside your tests\nvar Kinvey = require('kinvey-local');\n\ntest.expect(1);\nKinvey.User.login('username', 'password', {\n    success: function () {\n        test.ok(true);\n    }\n});\n```\n\n## Example Usage\n\nAn example of a business-logic repository is available in the [example](https://github.com/karimsa/kinvey-local/blob/master/example) directory.\n\n## Options\n\n### How to Set Options\n\nOptions for kinvey-local should be saved inside a JSON file in your repo and loaded through the `.setOptions()` member of the `kinvey-local` object:\n\n```javascript\nvar Kinvey = require('kinvey-local');\n\n// you can use a file path to load the document\nKinvey.setOptions(path.resolve('./kinvey-local.json'));\n\n// you can also send a pre-parsed document as an argument:\nKinvey.setOptions({\n    /* .. TODO: add values .. */\n});\n```\n\n### List of Options\n\n- `endpoints-base`: an absolute path to the directory with all the endpoints source code. (i.e. `options[\"endpoints-base\"] = path.resolve('./endpoints')`)\n- `email`: a JSON document consisting of the [nodemailer configuration](http://www.nodemailer.com/) to use for the email module. Most basic example (with gmail):\n```json\n{\n    \"email\": {\n        \"service\": \"Gmail\",\n        \"auth\": {\n            \"user\": \"my-email@gmail.com\",\n            \"pass\": \"my-password\"\n        }\n    }\n}\n```\n**Note:** you can set this property to the string `events` to turn the event reporting into an event-based thing, where the event emitter is: `Kinvey._events`\n- `collections`: a JSON document to add pre-made data stores to the phony local environment. The property names are the names of the data stores and the value must an array of documents. Sample:\n```json\n{\n    \"collections\": {\n        \"my-data-store\": [\n            {\n                \"_id\": \"xxx\",\n                \"name\": \"Document #1\"\n            }\n        ]\n    }\n}\n```\n- `users`: an array of user configurations. Sample:\n```json\n{\n    \"users\": [\n        {\n            // the _id property is required\n            // and must be a valid string containing\n            // only letters and numbers\n            \"_id\": \"identifier\",\n            \"username\": \"userone\",\n            \"password\": \"******\",\n            \"email\": \"user.one@example.com\"\n        }\n    ]\n}\n```\n\n## What isn't yet supported?\n\nThis project is still in its early stages, so the local environment does not support **everything**. I've tried to extend the support as much for it to work exactly as intended, but have no gotten around to *implementing hooks and the tempObjectStore* just yet. This is on the TODO list and will be supported soon.\n\n## Licensing\n\nFor license information, see [LICENSE.md](LICENSE.md).\n\n## Support\n\nI will try to keep this project as up-to-date as possible with the Kinvey spec, and bring the hooks support in soon.\nFor all issues/todo-wishes, please use the official [GitHub issues](http://github.com/karimsa/kinvey-local/issues) section.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Fkinvey-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarimsa%2Fkinvey-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Fkinvey-local/lists"}