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

nodejs-notebook

v1.2.2

Published

Note down or jot down anything in any editable file in the world.

Downloads

61

Readme

nodejs-notebook

npm version downloads GitHub GitHub last commit GitHub issues

Automate editing and managing any file type in the world

Links

Discord

Documentation

Installation

# with npm
npm install nodejs-notebook

Usage

Nodebook

Nodebook has a default class in case you want to edit files that do not have their own custom formatting.

Setup

const Nodebook = require('nodejs-notebook');

const myNotebook = new Nodebook.Nodebook('file name', 'txt');

fileName(options)

object options:

  • options.lower - Whether or not the name should be turned to lower case.

Return: The file name.

myNotebook.fileName({ lower: false });
// returns "file_name.txt"

clearLog()

Clears .booklog.txt

Nodebook.clearLog();
// clears .booklog.txt

resetFile()

Resets the file.

myNotebook.resetFile();
// resets file_name.txt

deleteFile(delay)

Deletes the file

number delay: Sets how many seconds before deleting the file.

myNotebook.deleteFile();
// Deletes the file instantly

myNotebook.deleteFile(3);
// Deletes the file in 3 seconds

fetchLine(line)

Fetches an existing line's content.

number line: The line number to get the information from.

myNootebook.fetchLine(1);
// fetches the first line

myNotebook.fetchLine(5);
// fetches the fifth line

Return: The line content.

deleteLine(line)

Sets an existing line in the file to empty.

number line: The line number to make empty.

myNotebook.deleteLine(1);
// sets the first line empty

editLine(line, key)

Replaces an existing lin ewith a new string.

number line: The line number to set it to.

string key: The string that will replace the line.

myNotebook.editLine(1, 'Welcome!');
// sets the first line to 'Welcome!'

addLine(key)

Adds a string at the next available line in the file.

string key: The string to add at the next available line.

myNotebook.addLine('Yippi Ki Yay!');
// adds 'Yippi Ki Yay!' to the next line

content()

Returns the file's content into a string.

console.log(myNotebook.content());
// should log the file's content