Package Exports
- npm-package-example-2
- npm-package-example-2/dist/index.js
- npm-package-example-2/dist/npm-package-example-2.esm.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (npm-package-example-2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
npm-package-example
Um exemplo de como criar um bom pacote para o NPM.
Transform a string between camelCase, PascalCase, Capital Case, snake_case, kebab-case and CONSTANT_CASE.
Objetivos
- Permitir tree-shaking
- Usar TypeScript
- Usar o eslint e o prettier
- Testar o pacote usando o Jest
- Publicar no NPM
- Automatização
- Executar os testes em pull-requests
- Gerar uma release no github automaticamente com o changelog
- Publicar uma nova versão da documentação quando modificar a pasta "docs"
- Escrever um bom README
- Criar um site de documentação
Installation
npm install npm-package-example-2 --saveyarn add npm-package-example-2Usage
import kebabCase from 'npm-package-example-2/kebabCase'
kebabCase('Hello world') // => hello-worldIt's also possible to use this package directly in the browser without any build tools.
<script type="module">
import { constantCase } from 'https://unpkg.com/npm-package-example-2?module'
constantCase('hello-world') // => HELLO_WORLD
</script>Core
camelCase('hello world') // => 'helloWorld'pascalCase('hello world') // => 'HelloWorld'kebabCase('hello world') // => 'hello-world'snakeCase('hello world') // => 'hello_world'dotCase('hello world') // => 'hello.world'capitalCase('hello world') // => 'Hello World'constantCase('hello world') // => 'HELLO_WORLD'
Documentation
See https://link-da-documentação.com
Development
Clone locally:
git clone https://github.com/iagobruno/npm-package-example
cd npm-package-example
yarn install
code .Running Tests
To run tests, run the command below.
yarn run test --watchBuilding
Create an optimized and minified version of the package in CJS, ESM and UMD ready to be distributed.
yarn run buildRelease a new version
yarn run releaseThis script uses release-it to:
- Prevent new releases if any tests fail.
- Bump package.json version.
- Create git tag.
- Push to remote.
- Post new release in GitHub with changelog.
- Publish a new version in npm registry.
Contributing
Contributions are always welcome!
- ⭐ Star this project on GitHub.
- 🐞 Submit bugs and feature requests. (Please first search for existing and closed issues)
- ❔ Engage and help each other in the Discussions tab.
- 🔍 Review the source code changes.
- 👨💻 You can submit any ideas as pull requests.
License
MIT