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

nyx-file

v1.0.3

Published

Nyx File is a lightweight JavaScript module designed to simplify file management in your Node.js applications. This module offers a series of robust features for manipulating files and folders, making it easy to work with the file system.

Downloads

187

Readme

nyx-file

Nyx File is a lightweight JavaScript module designed to simplify file management in your Node.js applications. This module offers a series of robust features for manipulating files and folders, making it easy to work with the file system.

Features

  • Create files: Create files with specified initial content.
  • Read files: Read the contents of text files.
  • Delete files: Securely delete files.
  • Check existence: Check whether a file exists.
  • Copy files: Copy files to a new location.
  • Move files: Move files to a new location, with the option of renaming.
  • and same for folder

Installation

  • To install Nyx File, use npm (Node Package Manager). Run the following command in your terminal:

npm install nyx-file

Manager

// Import the module
const { file_manager } = require('nyx-file');

//Create main folder its not necessary 
file_manager.create_main_folder('documents', 'Mainfolder');
//or
file_manager.create_main_folder('appdata', 'Mainfolder');

//Get Base dir
file_manager.get_base_dir('documents');
//or
file_manager.get_base_dir('appdata');

File

//Create File
file_manager.file.create('./file.txt', 'File');

//Read File
file_manager.file.read('./file.txt');

//Delete File
file_manager.file.delete('./file.txt');

//File Exists
const filePath = './file.txt';

if (file_manager.file.exists(filePath)) {
    console.log(`The file exists : ${filePath}`);
} else {
    console.log(`The file does not exist : ${filePath}`);
}

//File Copy
file_manager.file.copy('./file.txt', './file_copie.txt');

//File Move
file_manager.file.move('./file.txt', './new_folder/file_move.txt');

Folder

//Create Folder
file_manager.folder.create('./folder', 'Folder');

//Delete Folder
file_manager.folder.delete('./folder');

//Folder Exists
const folderPath = './folder';

if (file_manager.folder.exists(folderPath)) {
    console.log(`The folder exists : ${folderPath}`);
} else {
    console.log(`The folder does not exist : ${folderPath}`);
}

//Folder Copy
file_manager.folder.copy('./folder', './folder_copie');

//Folder Move
file_manager.folder.move('./folder', './new_folder/folder_move');

//Folder List
file_manager.folder.list('./folder');

Contributions

Contributions are welcome! If you'd like to improve the module, don't hesitate to submit a pull request.

License This project is licensed under the MIT license. See the LICENSE file for more information.