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

file-awesome

v1.0.3

Published

The file-awesome is a node module built in pure javascript, which offers easy file manilputation with predefined functions and even gives a flexibility to create your own as it simplifies basic CURD operations of fs library with syntatical sugar.

Downloads

4

Readme

file-awesome

The file-awesome is a node module built in pure javascript, offers easy file manipulation with predefined functions, and even gives the flexibility to create your own as it simplifies basic CRUD operations of fs library with syntactical sugar.

Getting Started

Install file-awesome using npm

npm install file-awesome

Import file-awesome

const fileAwesome = require('file-awesome");

file-awesome methods

All the methods need pathname of the file as parameter in string note: you need to come to root directory of your node.js project from file-awesome module by using ../../ followed by continuation of the file path.

eg. for a file named as text.txt in the root directory of you project path will be ../../text.txt

Simplified fs library methods

  • Read File - fileAwesome.getFileData(string pathname); var response = fileAwesome.getFileData("../../text.txt");

    getFileData reads the file data and returns it in string fromat which can be manipulated asccordingly bu the user.

  • Write File - fileAwesome.getFileData(string pathname,string data); fileAwesome.writeFileData("../../text.txt","Data that need to be written in the file");

    writeFileData takes pathname in first parameter and data that need to be written in the second.

  • Append File - fileAwesome.appendDataAtlast(string pathname,string data); fileAwesome.appendDataAtlast("../../text.txt","this data appends at the last in the file");

    appendDataAtlast appends the data at the last of the file.

  • Delete File Data - fileAwesome.removeFileData(string pathname); fileAwesome.removeFileData("../../text.txt");

    removeFileData deletes the whole data in the file.

  • Delete File - fileAwesome.deleteFile(string pathname); fileAwesome.deleteFile("../../text.txt");

    deleteFile deletes the file in the specified directory.

File manipulation methods

  • Number of Charaters in a file - fileAwesome.numberOfAllChar(string pathname); var response = fileAwesome.numberOfAllChar("../../text.txt");

    numberOfAllChar returns the number of char in a file, return type int.

  • Number of Charaters in a file without space - fileAwesome.numberOfAllChar(string pathname); var response = fileAwesome.charWithoutSpace("../../text.txt");

    charWithoutSpace returns the number of char in a file excluding spaces, return type int.

  • First Charater - fileAwesome.firstChar(string pathname); var response = fileAwesome.firstChar("../../text.txt");

    firstChar returns the first char in the specified file.

  • Last Charater - fileAwesome.lastChar(string pathname); var response = fileAwesome.lastChar("../../text.txt");

    lastChar returns the last char in the specified file.

  • First Word - fileAwesome.firstWord(string pathname); var response = fileAwesome.firstWord("../../text.txt");

    firstWord returns the first word in the specified file as string.

  • Last Word - fileAwesome.lastWord(string pathname); var response = fileAwesome.lastWord("../../text.txt");

    lastWord returns the first word in the specified file as string.

  • Count words - fileAwesome.wordsCount(string pathname); var response = fileAwesome.wordsCount("../../text.txt");

    wordsCount returns the the number of words persent in the specified file as int.

  • Lines words - fileAwesome.linesCount(string pathname); var response = fileAwesome.linesCount("../../text.txt");

    linesCount returns the the number of lines persent in the specified file as int.

  • Charater on the placeValue - fileAwesome.placeCharater(string pathname,int placeValue); var response = fileAwesome.placeCharater("../../text.txt",3);

    placeCharater returns the the char present on the specified int place in the file.

  • Word Present - fileAwesome.isPresent(string pathname,string value); var response = fileAwesome.isPresent("../../text.txt","Hello");

    isPresent returns the the boolean value to indicate weather the string is present in the file or not.

  • Replace first word occurance - fileAwesome.replaceWord(string pathname,string valueTobeReplaced,string replacingValue); var response = fileAwesome.replaceWord("../../text.txt","Hello","world");

    replaceWord replaces the first word occurance in the file which is specified in the second parameter and replaces it with the third parameter word of the function.