{"_id":"@askbills/npm-template-typescript","name":"@askbills/npm-template-typescript","dist-tags":{"latest":"1.0.0-canary.0"},"versions":{"1.0.0-canary.0":{"name":"@askbills/npm-template-typescript","version":"1.0.0-canary.0","description":"Typescript template to build npm package","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"prebuild":"rimraf dist","build":"tsup --config ./configs/tsup.config.ts","start":"npm run build && node dist/index.js","start:watch":"tsup src/index.ts --config ./configs/tsup.config.ts --watch --onSuccess 'node dist/index.js'","pretest":"rimraf coverage","test":"jest --config ./configs/jest.config.ts","lint":"eslint \"{src,tests}/**/*.ts\" --config ./configs/.eslintrc.js","lint:fix":"npm run lint -- --fix","prettier:format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"configs/**/*\" --config configs/.prettierrc","prepare":"husky install"},"repository":{"type":"git","url":"git+https://github.com/lengocduy/npm-template-typescript.git"},"keywords":["npm","template","npm-typescript","package-template"],"author":{"name":"Le Ngoc Duy"},"license":"MIT","bugs":{"url":"https://github.com/lengocduy/npm-template-typescript/issues"},"homepage":"https://github.com/lengocduy/npm-template-typescript#readme","devDependencies":{"@tsconfig/node18":"^18.2.2","@types/jest":"^29.5.11","@typescript-eslint/eslint-plugin":"^6.20.0","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.29.1","eslint-plugin-prettier":"^5.1.3","husky":"^9.0.10","jest":"^29.7.0","lint-staged":"^15.2.1","node-notifier":"^10.0.1","prettier":"3.2.4","rimraf":"^5.0.5","ts-jest":"^29.1.2","ts-node":"^10.9.2","tsup":"^8.0.1","typescript":"^5.3.3"},"lint-staged":{"**/*":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"configs/**/*\" --config configs/.prettierrc --ignore-unknown"},"engines":{"node":">=18.0.0"},"_id":"@askbills/npm-template-typescript@1.0.0-canary.0","gitHead":"6527a3a759a511fc5e1f7bcdfbb32d757d5c58dd","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-xnGptT6pAI5TxsCZeBsUX4rUxFNWlM4Ppdi+rxDJjiuTocTssBj3S0l8kuBN7nwptSnLQ5YhMiWcdBN5JIj/RA==","shasum":"77aa0329fc4efa3e7866762d1514edcdb20c60e1","tarball":"https://registry.npmjs.org/@askbills/npm-template-typescript/-/npm-template-typescript-1.0.0-canary.0.tgz","fileCount":9,"unpackedSize":11137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHJztK/rLfz+wjzSm3OwyVKRRrSwtL27yOTeRRg22/3+AiEAsXOVdDY/YVfNVd/hkNz2S7C3eOmijuCUbtLM4gB9t/k="}]},"_npmUser":{"name":"askbills","email":"askbills@gmail.com"},"directories":{},"maintainers":[{"name":"askbills","email":"askbills@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-template-typescript_1.0.0-canary.0_1708451085035_0.34312312513471954"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-20T17:44:44.955Z","1.0.0-canary.0":"2024-02-20T17:44:45.173Z","modified":"2024-02-20T17:44:45.637Z"},"maintainers":[{"name":"askbills","email":"askbills@gmail.com"}],"description":"Typescript template to build npm package","homepage":"https://github.com/lengocduy/npm-template-typescript#readme","keywords":["npm","template","npm-typescript","package-template"],"repository":{"type":"git","url":"git+https://github.com/lengocduy/npm-template-typescript.git"},"author":{"name":"Le Ngoc Duy"},"bugs":{"url":"https://github.com/lengocduy/npm-template-typescript/issues"},"license":"MIT","readme":"# npm-template-typescript\n\nSupports javascript developers who use npm to publish and share package quicker. Less time to setup utility tools to follow best-practices and more time on the core features of the package.\n\n## Prerequisites\n\nThe following tools need to be installed:\n\n-   [Git](http://git-scm.com/)\n-   [Node.js 18+](http://nodejs.org/)\n\n## Capabilities and Frameworks\n\n| Capability           | Module                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Dependence Framework | [`@tsconfig/node18`](https://www.npmjs.com/package/@tsconfig/node18) extend ts config node18+, [typescript](https://www.npmjs.com/package/typescript) adds optional types to JavaScript that support tools for large-scale JavaScript applications                                                                                                                                                                                        |\n| Build Tools          | [`tsup`](https://tsup.egoist.dev) Bundle your TypeScript library with no config, powered by esbuild                                                                                                                                                                                                                                                                                                                                       |\n| Coding Standard      | [eslint](https://eslint.org/) statically analyzes your code to quickly find and fix problems based on opt-in [rules](https://eslint.org/docs/latest/rules/), [prettier](https://prettier.io/docs/en/) an opinionated code formatter to build and enforce a style guide on save, [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) to turns off all rules that are unnecessary or might conflict with Prettier. |\n| Testing Framework    | [Jest](https://jestjs.io/) a delightful JavaScript Testing Framework with a focus on simplicity.                                                                                                                                                                                                                                                                                                                                          |\n| Useful Links         | [npmtrends](https://npmtrends.com/) Compare package download counts over time                                                                                                                                                                                                                                                                                                                                                             |\n\n## How to test\n\n```bash\nnpm test | yarn test\n```\n\n## How to check lint\n\n```bash\n# check lint's rules\nnpm run lint | yarn lint\n# check lint's rules and try to fix\nnpm run lint:fix | yarn lint:fix\n# format your code\nnpm run prettier:format | yarn prettier:format\n```\n\n## How to use\n\n### Clone the repository\n\n```bash\ngit clone git@github.com:lengocduy/npm-template-typescript.git\ncd npm-template-typescript\nnpm install | yarn install\n```\n\n### Open package.json file to edit some fields e.g. name, repository, etc\n\nwe can manage our package.json via [npm-pkg](https://docs.npmjs.com/cli/v10/commands/npm-pkg)\n\n## Collaboration\n\n1. We use the git rebase strategy to keep tracking meaningful commit message. Help to enable rebase when pull `$ git config --local pull.rebase true`\n2. Follow TypeScript Style Guide [Google](https://google.github.io/styleguide/tsguide.html)\n3. Follow Best-Practices in coding:\n    - [Clean code](https://github.com/labs42io/clean-code-typescript) make team happy\n    - [Return early](https://szymonkrajewski.pl/why-should-you-return-early/) make code safer and use resource Efficiency\n    - [Truthy & Falsy](https://frontend.turing.edu/lessons/module-1/js-truthy-falsy-expressions.html) make code shorter\n    - [SOLID Principles](https://javascript.plainenglish.io/solid-principles-with-type-script-d0f9a0589ec5) make clean code\n    - [DRY & KISS](https://dzone.com/articles/software-design-principles-dry-and-kiss) avoid redundancy and make your code as simple as possible\n4. Make buildable commit and pull latest code from `main` branch frequently\n5. Use readable commit message [karma](http://karma-runner.github.io/6.3/dev/git-commit-msg.html)\n\n```bash\n     /‾‾‾‾‾‾‾‾\n🔔  <  Ring! Please use semantic commit messages\n     \\________\n\n\n<type>(<scope>): ([issue number]) <subject>\n    │      │        |             │\n    |      |        |             └─> subject in present tense. Not capitalized. No period at the end.\n    |      |        |\n    │      │        └─> Issue number (optional): Jira Ticket or Issue number\n    │      │\n    │      └─> Scope (optional): eg. Articles, Profile, Core\n    │\n    └─> Type: chore, docs, feat, fix, refactor, style, ci, perf, build, or test.\n```\n","readmeFilename":"README.md"}