{"id":20418753,"url":"https://github.com/marcusoftnet/scradd","last_synced_at":"2025-03-05T04:17:02.407Z","repository":{"id":60703380,"uuid":"377783782","full_name":"marcusoftnet/scradd","owner":"marcusoftnet","description":"Adds script to a package.json file from the terminal or in scripts","archived":false,"fork":false,"pushed_at":"2022-10-03T09:36:24.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-16T07:03:16.896Z","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/marcusoftnet.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":"2021-06-17T09:58:58.000Z","updated_at":"2022-10-03T09:35:37.000Z","dependencies_parsed_at":"2022-10-03T10:43:00.637Z","dependency_job_id":null,"html_url":"https://github.com/marcusoftnet/scradd","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/marcusoftnet%2Fscradd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Fscradd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Fscradd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Fscradd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcusoftnet","download_url":"https://codeload.github.com/marcusoftnet/scradd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241960882,"owners_count":20049344,"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-11-15T06:34:35.088Z","updated_at":"2025-03-05T04:17:02.388Z","avatar_url":"https://github.com/marcusoftnet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScrAdd - Script Adder\n\nAdds script to a package.json file from the terminal or in scripts.\n\nI've often seen the need to programmatically be able to add a script or two to a `package.json`, for example when writing instructions for a tutorial or lesson. With ScrAdd this is now just a `npx` command away.\n\nScrAdd will not overwrite existing scripts, but rather inform you that one of those exists already.\n\n## Usage\n\n```bash\nnpx scradd {path to package.json} {script name} {script content} -o'\n```\n\n* `-o` - overwrites an existing script. Default behavior is to not overwrite existing scripts\n\n## Examples\n\n* Add a simple script to a local `package.json`\n\n  ```bash\n  npx scradd . test \"mocha .\"\n  ```\n\n* Add a simple script to a non-local `package.json`\n\n  ```bash\n  npx scradd ~/projects/myproj/package.json test \"mocha .\"\n  ```\n\n* Adding a script with separators in the name requires quotes:\n\n  ```bash\n  npx scradd . \"test:watch:integration\" \"mocha .\"\n  ```\n\n* Adding script content just about always requires quotes, since it contains spaces:\n\n  ```bash\n  npx scradd . \"test:watch\" \"npm t -- -R min -w ./src/\"\n  ```\n\n* Overwrite an existing script using the `-o` flag, for example the `test` script that is created by default:\n\n  ```bash\n  npx scradd . \"test\" \"mocha -R min\" -o\n  ```\n\n## Contribute\n\nThis is a quick and dirty first version of the code. I wanted it to be workable but not perfect.\n\nYou can contribute to this package by forking the repository and clone it to your computer. Remember to add tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusoftnet%2Fscradd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcusoftnet%2Fscradd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusoftnet%2Fscradd/lists"}