demo-publish-typescript-project
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

https://blog.liblab.com/typescript-npm-packages-done-right/ https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry

Steps

  • init repo
    • install packages
    • create file and directory
  • config typescript
    • src dir
    • out dir
    • add scripts - build - tsc to package.json
  • further typescript configuration
    • compability: target: 'es2015'
    • ship types: declaration: true, declarationMap: true
  • further package.json configuration
    • entry point when being imported
    "main": "dist/index.js",
    "types": "dist/index.d.ts",
    
    notice it's not .ts because it's compiled.
    • specify files to ship with the package
    files":[ "dist","src" ]
    
  • last step
npm
npm login
npm
  • optional
    • include repository in package.json

Readme

Keywords

none

Package Sidebar

Install

npm i demo-publish-typescript-project

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

1.27 kB

Total Files

6

Last publish

Collaborators

  • gattonero1052