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

regstr

v0.5.5

Published

JSON.stringify objects with RegExp properties and then JSON.parse json string resulted back into original objects. Converts RegExp object to be serializable - into pair of strings (key,value). Could be used for RegExp being bilaterally stringified and ge

Downloads

19

Readme

regStr module

introduction

regStr is a node.js module definining
The handler to JSON.stringify objects with RegExp properties and then JSON.parse json string resulted back.

usage in codes

var h = require('./regstr').regStr;
// or 
h = require('regstr').regStr;

Suppose the `o`` is a variable of some entity containing RegExp elements.

option 1

var jsonStr, clone, oj;

jsonStr = JSON.stringify(h.streger(o));
clone = h.reger(JSON.parse(jsonStr));

// Or

h.streger(o);
jsonStr = JSON.stringify(o);
oj = JSON.parse(jsonStr);
clone = h.reger(oj);

option 2

var replacer = h.replacer.bind(h);
var reviver = h.reviver.bind(h);

jsonStr = JSON.stringify(o, replacer);
clone = JSON.parse(jsonStr, reviver);

How

To download, to install and begin to use the package

  • go to the root of your project where you want to add regstr as dependent node.js module. Let's your project root dir is
    someDisk:\some-path-to\your-proj-dir. I will denote it as ~/your-proj-dir/`

  • You need to have node.js and npm have been installed on your pc.

  • The explanaions following presume Windows Command Prompt environement.

source

The package Source repository front page

Install, Test, Usage

  1. Open cmd Command Prompt Shell

Ctl+R cmd {Enter}

  1. Go to the root directory of your package. Make it as the current one. This may be just new empty directory named as has been mentioned earlier. Download and install the module locally using npm package manager
cd /d ~\your-proj-dir
npm i regstr

After the completion of all npm-node staff you could note some new staff in your dir:

  • the subdirectory node_modules has been created in ~\your-proj-dir\ dir with subfolder regstr or if your project allready had any stuff this subfolder has been added to your node_modules folder :
~\your-proj-dir
    |-- node_modules  
          |-- regstr
          |-- ...
  1. To check the correctness of downloading an installation go to the appropriates regstr subpackage directories and run test commands:
    at first to the uncycle dir
cd .\node_modules\regstr\
npm run test

See the test output 5. Return to you package root folder and check if the package is accessible

cd ..\..\

in ~\your-proj-dir\ directory as current one. Type

node
require.resolve('regstr')

Look for the output being something like this: diskLetter:\\etc\\..\\your-proj-dir\\node_modules\\regstr\\regstr.js

Exit from node.js REPL using command .exit and in Command Prompt type

npm run test

If you would have seen everything is as described then in any place of your .js files inside your project directory you could have access to regstr using the command

/* @type {Object} */
var r = require('regstr').regStr;  // ! in .regStr S - uppercase

// or alternatively
var rr = require('./node_modules\regstr\regstr.js').regStr;

Of course let or const could be used for assignement.

Explanation and details

The package has it's own explanation of usage, algorithm's details and is commented in details in script files. To get explanation in command propmt go into appropiate root folder of the package and run any of cmd commands

npm run explain
npm run explain-ciph
npm run explain-deciph

You are welcome!

Vladimir Uralov
[email protected]