{"id":23276243,"url":"https://github.com/dinoscapeprogramming/npx-shortcut-creator","last_synced_at":"2025-04-06T11:44:58.538Z","repository":{"id":61119473,"uuid":"548428254","full_name":"DinoscapeProgramming/NPX-Shortcut-Creator","owner":"DinoscapeProgramming","description":"https://github.com/DinoscapeProgramming/NPX-Shortcut-Creator","archived":false,"fork":false,"pushed_at":"2022-10-16T15:30:30.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T11:43:29.655Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DinoscapeProgramming.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":"2022-10-09T14:50:14.000Z","updated_at":"2022-10-16T15:22:18.000Z","dependencies_parsed_at":"2023-01-20T01:30:47.675Z","dependency_job_id":null,"html_url":"https://github.com/DinoscapeProgramming/NPX-Shortcut-Creator","commit_stats":null,"previous_names":["dinoscapeprogramming/npm-shortcut-creator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2FNPX-Shortcut-Creator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2FNPX-Shortcut-Creator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2FNPX-Shortcut-Creator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2FNPX-Shortcut-Creator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DinoscapeProgramming","download_url":"https://codeload.github.com/DinoscapeProgramming/NPX-Shortcut-Creator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478251,"owners_count":20945262,"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-12-19T21:30:03.245Z","updated_at":"2025-04-06T11:44:58.517Z","avatar_url":"https://github.com/DinoscapeProgramming.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NPX Shortcut Creator\r\nA package you can use to easily create NPX shortcuts\r\n\r\n## Documentation\r\n```js\r\nconst shortcuts = require('npx-shortcut-creator');\r\n```\r\n\r\n### Configure Options (optional)\r\n```js\r\nshortcuts.configureOptions({\r\n  type: \"bin\" || \"script\", // set the type of your shortcut\r\n  command: \"node {-url}\", // the command ran in the terminal =\u003e only required if type is script\r\n}).then(({ options }) =\u003e {\r\n  console.log(options);\r\n});\r\n```\r\n\r\n### Get Options\r\n```js\r\nshortcuts.getOptions().then(({ options }) =\u003e {\r\n  console.log(options);\r\n});\r\n```\r\n\r\n### Create shortcut\r\n```js\r\nshortcuts.createShortcut(\"myShortcut\", (firstArgument, secondArgument) =\u003e {\r\n  console.log(\"This are the arguments: \" + firstArgument + secondArgument);\r\n}, [\r\n  `\"My first argument\"`,\r\n  `\"My second argument\"`\r\n] /* IMPORTANT: dont forget to put quotation marks for strings */).then(({ name, arguments }) =\u003e {\r\n  console.log(\"Created a shortcut called \" + name + \"with the following arguments: \" + arguments.join(\", \"));\r\n});\r\n```\r\n\r\n### Delete shortcut\r\n```js\r\nshortcuts.deleteShortcut(\"myShortcut\").then(({ name }) =\u003e {\r\n  console.log(\"Deleted command called \" + name);\r\n});\r\n```\r\n\r\n### Get shortcuts\r\n```js\r\nshortcuts.getShortcuts().then(({ shortcuts }) =\u003e {\r\n  console.log(shortcuts);\r\n});\r\n```\r\n\r\n### Execute command\r\n```js\r\nshortcuts.executeShortcut(\"myShortcut\", [\"My first argument\", \"My second argument\"]).then(({ err, data: { stdout, stderr } }) =\u003e {\r\n  if (err) return console.log(err); // err =\u003e execution failed\r\n  console.log(stdout, stderr); // (stdout =\u003e successful output) || (stderr =\u003e failed output)\r\n});\r\n```\r\n\r\n### Install bin commands\r\n```js\r\nshortcuts.installBin().then(() =\u003e {\r\n  console.log(\"Installed all bin commands\");\r\n}); // basically runs \"npm install -g\"\r\n```\r\n\r\n### Terminal\r\n#### Install new commands\r\n```\r\nnpm install -g\r\n```\r\n\r\n#### Execute command\r\n##### Bin\r\n```\r\nnpx \u003ccommand\u003e\r\n```\r\n\r\n##### Script\r\n```\r\nnpm run \u003ccommand\u003e\r\n```\r\n\r\n#### Errors\r\n##### File already exists\r\nTry to remove all already installed commands and use the command then. After that you can add all removed commands back to the package file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinoscapeprogramming%2Fnpx-shortcut-creator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinoscapeprogramming%2Fnpx-shortcut-creator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinoscapeprogramming%2Fnpx-shortcut-creator/lists"}