npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nvvson

v1.0.2

Published

nvvson ======================= - a json-like array-only structure - for readonly config-file using

Downloads

3

Readme

nvvson

  • a json-like array-only structure
  • for readonly config-file using

install

  • npm install nvvson

usage

  const {der,ser}   = require("nvvson");

  #(....)   MEANS a comment;    "(" AND ")" must be escaped \( \)

  begin with "."  means a key,   key MUST be [_a-z][_a-z0-9]+

  begin with "'" means:
     'u   undefined
     'n   null
     't   true
     'f   false
     others are INVALID

  literal value only support <positive-int> OR <positive-bigint> OR 0, NOT support <negtive>, NOT support <double>
       
          
  @<s|d|b|n|j|v|t>(...) 

     @s(...)  MEANS a string:   "(" AND ")" must be escaped \( \) 
     @d(...)  MEANS a double
     @b(...)  MEANS a bigint
     @n(...)  MEANS a double OR bigint
     @t(...)  MEANS Date
     @j(...)  MEANS JSON          "(" AND ")" must be escaped \( \)

  
  comma CAN be   "," | ";" | <white-space> | <newline>      
  colon CAN be   ":" | "=" | <white-space> | <newline>

  block CAN only be  "[" "]" , can NOT be "{" "}"

  NOT support quote :  '"' "'" "`"  all are INVALID 

  

example

deserialize

var code = `
[
    'u, 'n, 't, 'f,
    1, @d(1.1), 123456789123456789123456789123456789, @t(2024-01-21T05:49:07.948Z), @s(a b c d e f g h),
   .k0   : 1,
   .kl   : @d(1.1),
   .k2   : 123456789123456789123456789123456789,   
   .k3   : @j([1,2,3,4]),                          #(this is a comment)
   .k4   : [
       'u, 'n, 't,'f,
       1, @d(1.1), 123456789123456789123456789123456789, @t(2024-01-21T05:49:07.948Z), @s(a b c d e f g h),
	   .k0   : 1,
	   .kl   : @d(1.1),
   ]
]
`;

 var val = der(code);

	[
	  undefined,
	  null,
	  true,
	  false,
	  1,
	  1.1,
	  123456789123456789123456789123456789n,
	  2024-01-21T05:49:07.948Z,
	  'a b c d e f g h',
	  1,
	  1.1,
	  123456789123456789123456789123456789n,
	  [ 1, 2, 3, 4 ],
	  [
	    undefined,
	    null,
	    true,
	    false,
	    1,
	    1.1,
	    123456789123456789123456789123456789n,
	    2024-01-21T05:49:07.948Z,
	    'a b c d e f g h',
	    1,
	    1.1,
	    k0: [Getter/Setter],
	    kl: [Getter/Setter]
	  ],
	  k0: [Getter/Setter],
	  kl: [Getter/Setter],
	  k2: [Getter/Setter],
	  k3: [Getter/Setter],
	  k4: [Getter/Setter]
	]

	> val[9]
	1
	> val.k0
	1
	> 
	> val[9] === val.k0
	true
	> val[9]=1000
	1000
	> val.k0
	1000
	> 
	> val.k0 = 1111
	1111
	> val[9]
	1111
	> 

serialize NOT symmetric WITH deserialize: the key will be dropped by default, vson is mainly for deser,

> ser(val)
"['u,'n,'t,'f,@d(1),@d(1.1),@b(123456789123456789123456789123456789),@t(2024-01-21T05:49:07.948Z),@s(a b c d e f g h),@d(1),@d(1.1),@b(123456789123456789123456789123456789),[@d(1),@d(2),@d(3),@d(4),],['u,'n,'t,'f,@d(1),@d(1.1),@b(123456789123456789123456789123456789),@t(2024-01-21T05:49:07.948Z),@s(a b c d e f g h),@d(1),@d(1.1),],]"
> 
> console.log(ser(val))
['u,'n,'t,'f,@d(1),@d(1.1),@b(123456789123456789123456789123456789),@t(2024-01-21T05:49:07.948Z),@s(a b c d e f g h),@d(1),@d(1.1),@b(123456789123456789123456789123456789),[@d(1),@d(2),@d(3),@d(4),],['u,'n,'t,'f,@d(1),@d(1.1),@b(123456789123456789123456789123456789),@t(2024-01-21T05:49:07.948Z),@s(a b c d e f g h),@d(1),@d(1.1),],]
> 
> der(ser(val))
[
  undefined,
  null,
  true,
  false,
  1,
  1.1,
  123456789123456789123456789123456789n,
  2024-01-21T05:49:07.948Z,
  'a b c d e f g h',
  1,
  1.1,
  123456789123456789123456789123456789n,
  [ 1, 2, 3, 4 ],
  [
    undefined,
    null,
    true,
    false,
    1,
    1.1,
    123456789123456789123456789123456789n,
    2024-01-21T05:49:07.948Z,
    'a b c d e f g h',
    1,
    1.1
  ]
]
> 

METHODS

APIS

 der(String)               -> NamedTuple 
 ser(NamedTuple, treat_ary_as_named_tuple=false, enable_circular_check = false)           -> String

LICENSE

  • ISC