Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simply-utils

michchan1.1kMIT0.69.0TypeScript support: included

Simple and generic JavaScript utils for common use cases, mainly developed and refractored from frontend projects.

node, npm, yarn, javascript, utils, utils-library, utils-lib, utilities, web, frontend

readme

Simply Utils

NPM

This is a simple, generic utils library that,

  • is written in a declarative style,
  • aims to compensate the lack of practical usage of some utils library like Lodash,
  • try to make pieces of codes smaller reusable blocks, and
  • is written in and refractored from some frontend React projects.

Feel free to make a pull request or raise a ticket of any issue.

Getting Started

This library is supposed to be used in most modern frontend projects (not limited to React) or some backend Node projects. It is designed to separate each function as a individual module, so that it is easier to implement code splitting.

Prerequisites

This library has major dependencies of:

  • Node (LTS recommended, minimum v8.0)
  • React 16
  • lodash 4

Others should be fine. But feel free to report any dependencies issue.

Installing

Install using npm or yarn:

npm i --save simply-utils
yarn add simply-utils

Usage

  1. Import separately using ES6 module (Recommended. This uses code-splitting style and is most cost-effective.):
    import isStr from 'simply-utils/string/isStr'

    const isString = isStr('testing')
  1. Named import as a whole using ES6 module:
    import utils from 'simply-utils'

    const isString = utils.isStr('testing')
  1. Separate import using ES6 module:
    import { isStr } from 'simply-utils'

    const isString = isStr('testing')
  1. Import using CommonJS
    const utils = require('simply-utils').default

Running the tests

No testing yet. Unit tests are planned to implement.

And coding style tests

  • Declarative programming
  • Stateless, pure function
  • Small code blocks (better controlling between 100-200 lines in a file)

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.69.0 (2023-12-26)

Features

  • upgrade puppeteer and chrome-aws-lambda to v10 (bcb2756)

0.68.4 (2023-12-24)

0.68.3 (2023-12-24)

Bug Fixes

  • launchPuppeteerBrowserSession: puppeteer browse close not being awaited (1d27934)

0.68.2 (2022-08-28)

0.68.0 (2022-08-28)

Features

  • formatCreditCardNum: detect and format card type (7a3fdc7)
  • formatCreditCardSecurityCode (28c7cde)
  • isValidCreditCardNum (7d23dbb)
  • isValidCreditCardSecurityCode (fdedd7e)

Bug Fixes

  • node_modules not working in build (057c58b)

0.67.0 (2022-08-03)

0.66.0 (2022-08-03)

0.65.0 (2022-08-01)

Features

  • export files from root instead of dist (a31781f)

0.64.1 (2022-08-01)

0.64.0 (2022-08-01)

Features

  • deprecated substr usages (f90020c)

0.63.2 (2022-04-02)

0.63.1 (2022-03-21)

0.63.0 (2022-03-21)

0.62.0 (2022-03-20)

Bug Fixes

  • remove git cache docs/string_isFullWIdthChar.js.html (e9bba5a)

0.61.6 (2022-03-10)

Bug Fixes

0.61.5 (2022-03-10)

Features

  • Add number/convertNumberBetweenMeasurementUnits (fd0df2e)
  • add string/variableChunkString (2af6d65)

0.61.4 (2022-02-27)

0.61.3 (2022-02-27)

0.61.4 (2022-02-27)

0.61.3 (2022-02-27)

0.61.2 (2022-02-27)

0.61.1 (2022-01-31)