npm-package-example-2
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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.

npm npm npm bundle size Module system npm type definitions

Tests Coveralls Code quality

Objetivos

  • [x] Permitir tree-shaking
  • [x] Usar TypeScript
  • [x] Usar o eslint e o prettier
  • [x] Testar o pacote usando o Jest
  • [ ] Publicar no NPM
  • [ ] Automatização
    • [x] Executar os testes em pull-requests
    • [x] Gerar uma release no github automaticamente com o changelog
    • [ ] Publicar uma nova versão da documentação quando modificar a pasta "docs"
  • [x] Escrever um bom README
  • [ ] Criar um site de documentação

Installation

npm install npm-package-example-2 --save
yarn add npm-package-example-2

Usage

import kebabCase from 'npm-package-example-2/kebabCase'

kebabCase('Hello world') // => hello-world

It'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 --watch

Building

Create an optimized and minified version of the package in CJS, ESM and UMD ready to be distributed.

yarn run build

Release a new version

yarn run release

This 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!

License

MIT

Dependencies (0)

    Dev Dependencies (22)

    Package Sidebar

    Install

    npm i npm-package-example-2

    Weekly Downloads

    1

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    35 kB

    Total Files

    32

    Last publish

    Collaborators

    • httpiago