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

nv-string-nest

v1.0.1

Published

nv-string-nest ======================= - a simple string split for nest block - the default block is '【' and '】' - for test block-comments in nvalng, nvlang NOT support /\* AND \*/

Downloads

1

Readme

nv-string-nest

  • a simple string split for nest block
  • the default block is '【' and '】'
  • for test block-comments in nvalng, nvlang NOT support /* AND */

install

  • npm install nv-string-nest

usage

  const {s2rng_json, s2str_json, _s2json_eng}   = require("nv-string-nest");

  s2str_json(s,                                     L="【",     R="】" )        
 
  s2rng_json(s:<s.length MUST le 67_108_864>        L="【",     R="】" )
     // 67_108_864 (2**64) IS: 
     //      the max <AS JString>'length for each code-file in nvalng
     //         2**26

example

     var cmt = `
          {
             k  【k.lengh must < 16】  :  100,

             d                         :  null 【

                  //如果不是null 需要包含d0
                  d0 : 【
                      d00: ~Number
                      d01: ~String
                  】
             
             】,
             a : [1,2,3,4,5]
                                                 
          }   
  
     `

using string directly

     var [bcmt, codes] = s2str_json(cmt);


	> bcmt
	[
	  [ 'k.lengh must < 16' ],
	  [
	    '\n \n                      //如果不是null 需要包含d0\n                      d0 : ',
	    [
	      '\n' +
		'                          d00: ~Number\n' +
		'                          d01: ~String\n' +
		'                      '
	    ],
	    '\n                 \n                 '
	  ],
	  [ '...' ]
	]
	> 
	
          > console.log(codes.join(""))

          {
             k    :  100,

             d                         :  null ,
             a : [1,2,3,4,5]
                                                  
          }   

using range, this is for transfer using

    const {encd_srng,decd_srng} =require("nv-facutil-csutil");

    var [bcmt, codes] = s2rng_json(cmt);


	> bcmt
	[
	  [ 2550136887 ],
	  [ 7985955005, [ 12750684451 ], 19595788616 ],
	  [ 25635586433 ]
	]
	> 
	> codes
	[ 37, 3758096502, 22078816637, 25904021963 ]
	> 
	>  
	> decd_srng(2550136887)
	[ 38, 55 ]
	> cmt.slice(38,55)
	'k.lengh must < 16'
	> 
	> 

using box

            // box is just a array;  TO stop iteration

	> var [bcmt, codes] = _s2json_eng(cmt);
	> 
	> bcmt
	[
	  [ ___Box___(2) [ 38, 55 ] ],
	  [
	    ___Box___(2) [ 119, 189 ],
	    [ [___Box___] ],
	    ___Box___(2) [ 292, 328 ]
	  ],
	  [ ___Box___(2) [ 382, 385 ] ]
	]
	> codes
	[
	  ___Box___(2) [ 0, 37 ],
	  ___Box___(2) [ 56, 118 ],
	  ___Box___(2) [ 329, 381 ],
	  ___Box___(2) [ 386, 459 ]
	]
	> 
	> 

METHODS

APIS

	{
	  check_pair_cfg: [Function: check_pair_cfg],
	  _char: {
	    zh_lbk_cd: 12304,
	    zh_rbk_cd: 12305,
	    zh_langle_cd: 12298,
	    zh_rangle_cd: 12299,
	    zh_lp_cd: 65288,
	    zh_rp_cd: 65289,
	    zh_lbk_ch: '【',
	    zh_rbk_ch: '】',
	    zh_langle_ch: '《',
	    zh_rangle_ch: '》',
	    zh_lp_ch: '(',
	    zh_rp_ch: ')'
	  },
	  DFLT_ENCD: [Function: DFLT_ENCD],
	  _s2json_eng: [Function: _s2json_eng],
	  S2RNG_ENCD: [Function: S2RNG_ENCD],
	  s2rng_json: [Function: s2rng_json],
	  S2STR_ENCD: [Function: S2STR_ENCD],
	  s2str_json: [Function: s2str_json]
	}

LICENSE

  • ISC