0.0.34 • Published 2 years ago

@leothorp/npm-package-template v0.0.34

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

baseline npm package example/scaffolder.

Usage:

npm exec --prefer-online @leothorp/npm-package-template new-pkg-name

notes/references:

-ES6 module reference: https://medium.com/digio-australia/migrating-an-npm-package-to-use-es-modules-d59877963d61 -uses conditional exports: https://nodejs.org/api/packages.html#conditional-exports

-partially modelled after the nanoid package.

-assumes the user will handle compilation for the browser themselves

Steps taken 1. create dir 2. git init 3. npm init 4. edit package.json- license, semver (0.0.1), name (use scoped name if desired), description 5. mkdir src && touch src/main.js index.js 6. touch .gitignore .npmignore 6.5 add stuff to .gitignore (node_modules) 7.

"sideEffects": false, if that is the case

  1. in package.json:
  "type": "module",
``` and add exports for node/browser as appropriate (see package.json here for example)

9. add repo/author to package.json 
10. make gh repo with github cli (assumes public desired, --private if not):

gh repo create --source=. --public --push 

gh repo create command reference: https://cli.github.com/manual/gh_repo_create

11. for cli: 'bin' dir, entrypoint file/package.json entry
12.  echo "{}" > .prettierrc
13. to cut a release: (assumes npm account exists and is logged in via npm login) can use the bash_profile function below, npm-pub. 
example usage: `npm-pub "new commit message"`

function npm-pub() { npm version patch && \ npm publish --access public && \ git push origin HEAD && \ git push --tags }

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago