JSPM

  • Created
  • Published
  • Downloads 442
  • Score
    100M100P100Q103465F
  • License MIT

JS utility functions to E-Com Plus (not only) related apps

Package Exports

  • @ecomplus/utils

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 (@ecomplus/utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ecomplus-utils

CodeFactor npm version license mit

JS utility functions to E-Com Plus (not only) related apps

Changelog

Usage

The @ecomplus/utils package provides a list of methods, each one is a utility function related to e-commerce apps and E-Com Plus APIs and schemas.

It's available for both Node.js and browser environments, and can also be imported entirely or partially with ES modules.

import {
  i18n,
  formatMoney,
  minQuantity,
  price,
  // ...
} from '@ecomplus/utils'

i18n({ en_us: 'Hello', pt_br: 'Olá' })
// => 'Hello'
formatMoney(10)
// => $10.00

Development

We're using Conventional Commits, all commit messages must follow these conventions.

For documentation, we're using jsdoc, all methods should be well documented.

Contributing

  1. Fork the repository;

  2. Create a new branch with the name of your proposal;

  3. Clone the repository:

git clone git@github.com:{user}/ecomplus-utils.git
  1. Move to folder and install dependencies:
cd ecomplus-utils
npm i
  1. Run dev server and use global ecomUtils or edit test/demo.js for tests on http://localhost:9314/:
npm run serve
  1. Commit changes following Conventional Commits;

  2. Create a new PR describing your proposal :)

Deploy

Take a look on package.json scripts:

  • npm run doc - Update jsdoc/docdash generated documentation;
  • npm run release - Generate changelog and new version;