npm TypeScript Package Template
About This Project
A template project for creating a TypeScript package for npm.
New Package Steps
Follow these steps after creating a new repository from this template.
The same steps appear in README.md, docs/index.md, and .github/copilot-instructions.md; keep all three copies identical until the final step removes them.
- In
package.json, updatename,version,description,author,homepage,repository.url,bugs.url, andkeywordsfor the new package and repository. - In
.github/workflows/package-publish.yml, change thescopeof the GitHub Packages job (@blwatkins) to the GitHub account or organization that owns the new repository. GitHub Packages requires the package name’s scope to match that owner. If the npm scope of the new package does not match it, remove thepublish-githubjob instead, rename the workflow to drop “GitHub Package” from itsname, and remove GitHub Packages from the “Tech Stack” section and from the name and description of thepackage-publish.ymlrow of the “GitHub Actions CI” table in.github/copilot-instructions.md. - In
tsdown.config.ts, renameglobalNamefor the new package. It only applies to IIFE or UMD output, so remove it andoutputOptions.globalsif the package will only ever ship ESM. - Replace the
hello-worldexample module:- Replace
src/hello-world/andtest/hello-world/with the package’s own modules, and re-export each module fromsrc/index.ts. - Point the
entryPointsintypedoc.jsonat each module’s index file. - Update the “Directory Structure” section of
.github/copilot-instructions.md.
- Replace
- In
typedoc.json, updatenavigationLinksandcustomFooterHtml. - In
docs/_config.yml, updatetitle,description, andminima.social_links. Leave the npm social linkurlas'#'until the first publish. - In
README.mdanddocs/index.md, update the title, description, documentation links, and every badge and link that names@blwatkins/templateornpm-typescript-package-template. - Remove the sample documentation:
- Delete the contents of
docs/doc/anddocs/releases/. - Remove the sample entries from
docs/releases.md, and update its front matterauthoranddescription. - Replace the content of
docs/resources-and-references.md, and update its front matterauthoranddescription.
- Delete the contents of
- Update the owners in
.github/CODEOWNERSand the accounts in.github/FUNDING.yml, or removeFUNDING.yml. - Update the copyright holder and year in
LICENSE, every file header,velocity-copyright-template.txt, the footer ofREADME.md, anddocs/_includes/footer.html. - Review
.github/copilot-instructions.md:- Update the “Project Overview” section.
- Decide whether to keep the shared error type, assertion, and type guard conventions. To keep them, add
@blwatkins/utilsas a dependency. To drop them, remove the sections that reference@blwatkins/utils.
- Run
npm installto regeneratepackage-lock.jsonfor the new package name, then runnpm run validate. - Remove this “New Package Steps” section from
README.md,docs/index.md, and.github/copilot-instructions.md.
Documentation
License
The source code of this project is licensed under the MIT License. The full text of the license is included with the project source code.
Project Links and Status Badges
npm
Socket
Bundlephobia
Package Phobia
GitHub
GitHub Actions
Sources and Technical Notes
Thank Yous
A huge thank you to all the open source contributors who have made this project possible by creating and maintaining the libraries and tools used in this project, and to the open source community for fostering collaboration and innovation.
A special thank you to all the educators, mentors, and content creators who have shared their knowledge and expertise in the fields of algorithmic art, web development, and computer science. Thank you for giving me the tools, resources, opportunities, support, and inspiration to learn and grow as a developer.