{"id":22156168,"url":"https://github.com/leothorp/npm-package-template","last_synced_at":"2025-03-24T14:31:47.943Z","repository":{"id":41877587,"uuid":"510455595","full_name":"leothorp/npm-package-template","owner":"leothorp","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-30T08:42:55.000Z","size":275,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T19:24:50.181Z","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/leothorp.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}},"created_at":"2022-07-04T17:55:17.000Z","updated_at":"2023-03-10T08:03:06.000Z","dependencies_parsed_at":"2022-07-12T18:18:24.416Z","dependency_job_id":null,"html_url":"https://github.com/leothorp/npm-package-template","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leothorp%2Fnpm-package-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leothorp%2Fnpm-package-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leothorp%2Fnpm-package-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leothorp%2Fnpm-package-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leothorp","download_url":"https://codeload.github.com/leothorp/npm-package-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245289497,"owners_count":20591083,"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-02T02:37:34.331Z","updated_at":"2025-03-24T14:31:47.922Z","avatar_url":"https://github.com/leothorp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-package-template\n\nScaffolding script for developing npm packages.\n\nUsage: \n```\nnpm exec --prefer-online @leothorp/npm-package-template new-pkg-name\n```\n\n## Features\n* Generates suitable package.json and directory structure fulfilling minimum requirements for a publishable npm package.\n* Includes re-exports from both index.js and index.browser.js, which are referenced by the package.json's `exports` field for distinct Node / Browser versions of the package.\n* Adds a placeholder `bin` script for developing a command line executable.\n* Basic default testing script to re-run your index.js code.\n\n\n## Developing a package\n1. `npm exec --prefer-online @leothorp/npm-package-template new-pkg-name` , which will generate a new project named `new-pkg-name` (or whatever name you specified) and `cd` into it.\n\n2. Start adding your package code to src/index.js. By default, the template expects the exported \"main\" function there to be the entrypoint.\n\nTo quickly publish new patch versions of an npm package during development, this shell function may be convenient (past this into ~/.bash_profile or ~/.zprofile, depending on whether you use bash or zsh for your shell):\n```\nfunction npm-pub() {\n    npm version patch \u0026\u0026 \\\n    npm publish --access public \u0026\u0026 \\\n    git push origin HEAD \u0026\u0026 \\\n    git push --tags\n}\n```\nUsage: \n```npm-pub``` \nfrom within your package directory to bump the patch version, publish to npm, and push to your repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleothorp%2Fnpm-package-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleothorp%2Fnpm-package-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleothorp%2Fnpm-package-template/lists"}