JSPM

npm-package-example-2

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q23046F
  • License MIT

A good npm package

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.

npm npm npm bundle size Module system npm type definitions

Tests Coveralls Code quality

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