1.0.1 • Published 11 months ago
nv-random-just-quote-str v1.0.1
nv-random-just-quote-str
- generate a random string, which could be directly using '"' + str + '"' when do JSON.stringify
- nvlang support a subset-of-json called pson
pson
pson string must can be directly quote when do stringify AND NOT include 4-bytes UTF8
pson number's absolute value must between [0.000001,1e+21)
// to avoid using scientific notation
// scientific notation IS hard to understand , its boring
- this pkg is for test pson, normally USELESS
install
- npm install nv-random-just-quote-str
usage
const {
ascii_only,
latin1_only,
without_u84, // without 4-bytes utf8(code point >=65536)
with_u84,
} = require("nv-random-just-quote-str");
example
> x.ascii_only(6)
't G;:%'
> x.ascii_only(6)
'T++!z}'
> x.ascii_only(6)
'(l)r<i'
> x.ascii_only(6)
'h2,`?x'
> x.ascii_only(6)
'Jl$u\x7F_'
> x.ascii_only(6)
' >u\x7F[&'
> x.ascii_only(6)
'Hp:Drn'
> x.ascii_only(6)
'4.{N;v'
> x.ascii_only(6)
'SB]/9$'
> x.ascii_only(6)
'&{L)yi'
> x.ascii_only(6)
'_n|cQH'
>
>
> v = x.ascii_only(6)
'bpht;f'
>
> '"' + v +'"' === JSON.stringify(v)
true
METHODS
APIS
LICENSE
- ISC
1.0.1
11 months ago