3.0.4 • Published 5 months ago

@rosmarinus/common-utils v3.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@rosmarinus/common-utils

This npm package contains some function encapsulation commonly used in development, which is more engineering-oriented.

How to Install

npm i @rosmarinus/common-utils

Functions introduction

  1. logger

This module encapsulates chalk as output, and the input parameters are the same as the console module.

  1. sleep

This module encapsulates several common delay methods into promise output

  1. uuid

This module is a wrapper for the uuid npm library

  1. AsyncTask

AsyncTask is an encapsulation of promise and is used in scenarios where calls and callbacks are separated.

  1. FileLogger

FileLogger is a file logger that can be used in nodejs and environments to output log to a local file.

  1. json

This module is a wrapper for the JSON.stringify and JSON.parse methods to make them more secure.

  1. is-type

Some functions to determine the type of data, such as isArray, isObject, isString, etc.

  1. try

This module is a wrapper for try-catch, which can return undefined when an error occurs.

  1. url

This module is a collection of url handle function, such as handling url params to object.

About Tree shaking

this npm doesn't support tree shaking, because it use some npm packages that don't support tree shaking.

But there is always a way to solve this problem, you can use babel-plugin from this npm to solve this problem.

// babel.config.js
module.exports = {
  plugins: ['@rosmarinus/common-utils/babel-plugin'],
};
3.0.4

5 months ago

3.0.3

5 months ago

3.0.2

6 months ago

3.0.1

6 months ago

2.5.0

6 months ago

2.4.2

6 months ago

2.4.1

6 months ago

2.4.0

6 months ago

2.3.1

6 months ago

2.3.0

6 months ago

2.2.6

6 months ago

2.2.0

6 months ago

2.2.5

6 months ago

2.2.4

6 months ago

2.2.3

6 months ago

2.2.2

6 months ago

2.1.4

6 months ago

2.1.3

6 months ago

2.1.2

6 months ago

2.1.1

6 months ago

2.0.12

6 months ago

2.0.11

6 months ago

2.0.10

6 months ago

2.0.9

6 months ago

2.0.6

6 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.3

6 months ago

2.0.2

6 months ago

2.0.1

6 months ago

2.0.0

7 months ago

1.4.0

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.2.3

7 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.2.0

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago