@58fe/utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

Utils

JS哆啦A梦工具包

Install

npm install @58fe/utils  --save

Usage

cookie

import { cookie } from '@58fe/utils';

cookie.getCookie(name);
cookie.setCookie(name, value, outdays, path, domain);

getOS

import { getOs } from '@58fe/utils';

console.log(getOs()); // android/wp/ios

urlQuery

import { urlQuery } from '@58fe/utils';

// for example url: https://www.baidu.com/?a=1&b=2
console.log(urlQuery.query('a'));
// 1
console.log(urlQuery.queryAll());
// {a: 1, b: 2}

calcaulate

import { calcaulate } from '@58fe/utils';
calcaulate(); // must do
const num = 7;
console.log(num.add(1));
// 8
console.log(num.sub(2));
// 5
console.log(num.mul(2));
// 14
console.log(num.div(2));
// 3.5
console.log(num.toFixedNew(2));
// 7
console.log(7.3456.toFixedNew(2));
// 7.35

其他

Readme

Keywords

Package Sidebar

Install

npm i @58fe/utils

Weekly Downloads

16

Version

1.0.10

License

ISC

Unpacked Size

15.7 kB

Total Files

17

Last publish

Collaborators

  • skybjf
  • rockolin
  • reking
  • imlimiao
  • xiaoyuya
  • felix_xue
  • zhangboyu
  • marinamumu
  • bestvist
  • liuhanbing