2.2.2 • Published 9 months ago

ygb v2.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

About

Load useful global functions and variables for server (nodejs) and client (react and nextjs).

global category (server)

require('ygb') // load all global except bigger file size: ago() // all of "ygb/base" + pc(), oa2o(), toFixed(), toDate(), lgTime(), hr, toUcSpace(), uid()
require('ygb/all') // load all global
require('ygb/base') // wait(), exit(), isArray(), isObject(), stringify(), log(), fp()
require('ygb/time') // wait(), lgTime(), ago(), toDate()
require('ygb/num') // fp(), pc(), toFixed()
require('ygb/str') // stringify()..
require('ygb/arr') // isArray() // abbr: ygb/ar
require('ygb/obj') // isObject(), oa2o() // abbr: ygb/ob
require('ygb/vars') // hr

global category (client)

import('ygb/client') // load all global except bigger file size: ago() // all of "ygb/client/base" + oa2o(), toFixed(), toDate(), lgTime() // abbr: 'ygb/c'
import('ygb/client/all') // load all global // abbr: 'ygb/c/all'
import('ygb/client/base') // wait(), exit(), isArray(), isObject(), stringify(), fp(), pc(), toUcSpace(), uid() // abbr: 'ygb/c/base'
import('ygb/client/react') // all of "ygb/c" + react() // abbr: 'ygb/react', 'ygb/c/react'

load global functions individually (ygb/s/)

require('ygb/s/wait') // wait() // for await wait()
require('ygb/s/exit') // exit(),stop(),X(),xx() // process.exit() abbr
require('ygb/s/stringify') // stringify(),sify() // same as JSON.stringify()
require('ygb/s/isArray') // isArray(),isArr(),isAr() // same as Array.isArray()
require('ygb/s/isObject') // isObject(),isObj,isOb() // check plain object (not array, class, Date, ..)
require('ygb/s/toUcSpace') // toUcSpace(),ucSpace() // mod space into unicode "\u00A0"

load global functions (dependency) individually (ygb/r/)

require('ygb/r/log') // log(),log., lg(),lg., toc., out(), inspect(), insp(), W(), warn(), warning(), E(), err(), error(), // require("ylg").gb()
require('ygb/r/fp') // fp(),num(),toNum() // floating point
require('ygb/r/pc') // pc(),prec(),toprecision(),toPrecision() // precision
require('ygb/r/toFixed') // tofixed with ceil and floor
require('ygb/r/oa2o') // object array to array
require('ygb/r/lgTime') // lgTime(),logTime() // log time at interval
require('ygb/r/toDate') // timestamp to date
require('ygb/r/ago') // ago(),timeAgo() // timestamp to time ago
require('ygb/r/uid') // uid() // get unqiue id // <div key={uid()}>
require('ygb/r/react') // useState(), useEffect()

load global variables individually (ygb/v/)

require('ygb/v/hr') // draw a line in terminal

notes

All abbr is avaialble when loading the global category (refer to individual for abbr)

Most of the loaded function usage can refer to the source code and https://www.npmjs.com/~jydev

etc

ygb stands for "Y global"

1.1.3

10 months ago

2.2.1

9 months ago

2.1.2

10 months ago

2.0.3

10 months ago

2.2.0

9 months ago

2.1.1

10 months ago

2.0.2

10 months ago

2.1.4

10 months ago

2.0.5

10 months ago

2.2.2

9 months ago

2.1.3

10 months ago

2.1.6

10 months ago

2.0.7

10 months ago

2.1.5

10 months ago

2.0.6

10 months ago

2.1.8

9 months ago

2.1.7

9 months ago

2.0.8

10 months ago

2.1.0

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago

2.1.9

9 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago