Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-save

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-save

A stupidly simple way to persist data.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

simple-save

A stupidly simple way of persisting values in nodejs. This will rewrite tagged literal values that are assigned to variabled in your source code.

Install

  npm install simple-save

Usage

save(variableName:string, newValue, [suffix:string])

Call the package with the name of the variable you want to persist, and the new value. This will replace the assignments of all tagged occurrences of this variable with the new value.

  var save = require("simple-save")();
  /*SS*/ var test = 3;

  test = 5
  save("test", test);

Advanced

If you want to set a custom tag instead of the default of "SS", pass in a string:

  var save = require("simple-save")("SAVE");

You can also set custom tag suffixes on a per-variable basis as follows. In the following example, only the value of the variable within the function is modified.

  var save = require("simple-save")();
  /*SS*/ var test = 3;

  function ttt(){
    /*SS:1*/ var test = 3;
  }

  test = 5
  save("test", test, "1");

Keywords

FAQs

Package last updated on 10 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc