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

steno

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steno

Specialized fast async file writer

  • 3.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
248K
decreased by-64.12%
Maintainers
1
Weekly downloads
 
Created

What is steno?

The steno npm package is a simple, fast, and lightweight library for writing JSON files atomically. It ensures that data is written to disk safely and without corruption, making it ideal for applications that need to frequently update JSON files.

What are steno's main functionalities?

Atomic Write

This feature allows you to write JSON data to a file atomically. The `writeFile` method ensures that the data is written safely, preventing file corruption.

const steno = require('steno');
const fs = require('fs');

const data = { key: 'value' };

steno.writeFile('data.json', JSON.stringify(data), (err) => {
  if (err) throw err;
  console.log('Data written successfully');
});

Synchronous Write

This feature allows you to write JSON data to a file synchronously. The `writeFileSync` method ensures that the data is written safely and the operation is completed before moving on to the next line of code.

const steno = require('steno');
const fs = require('fs');

const data = { key: 'value' };

try {
  steno.writeFileSync('data.json', JSON.stringify(data));
  console.log('Data written successfully');
} catch (err) {
  console.error('Error writing data:', err);
}

Other packages similar to steno

Keywords

FAQs

Package last updated on 26 Dec 2023

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