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

sander

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

sander

Promise-based power tool for common filesystem tasks

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
114K
decreased by-60.55%
Maintainers
1
Weekly downloads
 
Created

What is sander?

The sander npm package is a promise-based library for working with the filesystem. It provides a more modern and convenient API for file operations compared to the traditional Node.js fs module.

What are sander's main functionalities?

Reading Files

This feature allows you to read the contents of a file. The readFile method returns a promise that resolves with the file's contents.

const sander = require('sander');

sander.readFile('path/to/file.txt', { encoding: 'utf8' })
  .then(data => {
    console.log(data);
  })
  .catch(err => {
    console.error(err);
  });

Writing Files

This feature allows you to write data to a file. The writeFile method returns a promise that resolves when the file has been written.

const sander = require('sander');

sander.writeFile('path/to/file.txt', 'Hello, world!')
  .then(() => {
    console.log('File written successfully');
  })
  .catch(err => {
    console.error(err);
  });

Copying Files

This feature allows you to copy a file from one location to another. The copyFile method returns a promise that resolves when the file has been copied.

const sander = require('sander');

sander.copyFile('path/to/source.txt', 'path/to/destination.txt')
  .then(() => {
    console.log('File copied successfully');
  })
  .catch(err => {
    console.error(err);
  });

Deleting Files

This feature allows you to delete a file. The unlink method returns a promise that resolves when the file has been deleted.

const sander = require('sander');

sander.unlink('path/to/file.txt')
  .then(() => {
    console.log('File deleted successfully');
  })
  .catch(err => {
    console.error(err);
  });

Creating Directories

This feature allows you to create a new directory. The mkdir method returns a promise that resolves when the directory has been created.

const sander = require('sander');

sander.mkdir('path/to/directory')
  .then(() => {
    console.log('Directory created successfully');
  })
  .catch(err => {
    console.error(err);
  });

Other packages similar to sander

FAQs

Package last updated on 13 Sep 2014

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