{"id":16844752,"url":"https://github.com/stephanhoyer/chuk-cb","last_synced_at":"2025-04-05T10:42:27.917Z","repository":{"id":5997577,"uuid":"7220355","full_name":"StephanHoyer/chuk-cb","owner":"StephanHoyer","description":"Chuk plugin which simplifys writing callbacks in REPL session.","archived":false,"fork":false,"pushed_at":"2023-12-15T20:22:38.000Z","size":7,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T01:37:43.367Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StephanHoyer.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2012-12-18T09:02:19.000Z","updated_at":"2013-10-21T17:10:45.000Z","dependencies_parsed_at":"2025-02-23T10:00:17.152Z","dependency_job_id":null,"html_url":"https://github.com/StephanHoyer/chuk-cb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanHoyer%2Fchuk-cb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanHoyer%2Fchuk-cb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanHoyer%2Fchuk-cb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanHoyer%2Fchuk-cb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephanHoyer","download_url":"https://codeload.github.com/StephanHoyer/chuk-cb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325645,"owners_count":20920713,"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":[],"created_at":"2024-10-13T12:56:30.770Z","updated_at":"2025-04-05T10:42:27.900Z","avatar_url":"https://github.com/StephanHoyer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" [![Build\n Status](https://travis-ci.org/StephanHoyer/chuk-cb.png?branch=master)](https://travis-ci.org/StephanHoyer/chuk-cb)\n\n# chuk-cb\n\n[Chuk](./chuk) plugin which simplifys writing callbacks in REPL session.\n\n## Installation\n\n```bash\n$ npm install chuk-cb\n```\n\n## Usage\n\nAfter installing cb add this code to your `Chukfile`\n\n```js\nscope.cb = require('chuk-cb')(scope);\n```\n\nYour `Chukfile` may now look like this:\n\n```js\nmodule.exports = function(scope) {\n  // some other initialisation\n  scope.cb = require('chuk-cb')(scope);\n};\n```\n\nIf you now run `chuk` and you have a call which requires a callback function\nwhich arguments you want to use if called, simply pass `cb` to that call.\nSo instead of\n\n```\nchuk \u003e var foo\nchuk \u003e User.findOne({name: 'foo'}, function(err, user) { foo = user; })\nchuk \u003e user\n{ name: 'foo', haircolor: 'bar' }\n```\n\nsimply write\n\n```\nchuk \u003e User.findOne({name: 'foo'}, cb)\n_0 = null\n_1 = [object Object]\nundefined\nchuk \u003e _1\n{ name: 'foo', haircolor: 'bar' }\n```\n\nAs you can see `cb` adds the parameters of it to the global scope.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Stephan Hoyer \u003cste.hoyer@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephanhoyer%2Fchuk-cb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephanhoyer%2Fchuk-cb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephanhoyer%2Fchuk-cb/lists"}