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

@ethronpi/fs

v0.3.0

Published

Ethron.js plugin for file system commands.

Downloads

1

Readme

@ethronpi/fs

NPM version Total downloads

Ethron.js plugin for file system ops.

Developed in Dogma, compiled to JavaScript.

Engineered in Valencia, Spain, EU by EthronLabs.

Use

const fs = require("@ethronpi/fs");

fs.cp task

It copies a file or directory:

fs.cp({src, dst, force})
fs.cp(src, dst)
  • src (string, required). File/directory to copy.
  • dst (string, required). Where to copy.
  • force (bool). Must the file be copied if dst exists? Default: false.

Example:

fs.cp({
  src: "/opt/redis/conf/redis.conf",
  dst: "/bk/redis/conf/redis.conf",
  force: true
})

fs.rm task

It removes a file or a directory:

fs.rm({path})
fs.rm(path)
  • path (string, required). File to remove.

Example:

fs.rm({
  path: "/opt/redis/conf/redis.conf"
})

fs.mkdir task

It creates a directory:

fs.mkdir({path})
fs.mkdir(path)
  • path (string, required). Directory to create.

Example:

fs.mkdir({
  path: "/opt/redis"
})

fs.mv task

It moves a file or a directory to other path:

fs.mv({src, dst, force})
fs.mv(src, dst)
  • src (string, required). Path to move.
  • dst (string, required). Path where to move.
  • force (bool). Overwrite if dst exists? Default: false.

fs.append task

It appends content to a file:

fs.append({path, data, line})
fs.append(path, data)
  • path (string, required). File path.
  • data (string, required). Content to add.
  • line (number). Line where to insert the data. Negative values allowed.

Example

fs.append({
  src: "myfile.txt",
  data: "This is the content to append."
})

fs.exists task

It checks whether a path exists:

fs.exists({path})
fs.exists(path)
  • path (string, required). Entry path.

Example:

fs.exists({
  path: "myfile.txt"
})

fs.ls task

It returns the directory entries:

fs.ls({path, abs})
fs.ls(path, abs)
  • path (string, required). Directory path.
  • abs (bool). Return the absolute child paths. Default: false.