Nodebook
  • Introduction
  • Methods
  • Default Classes
    • Nodebook
  • JS
    • JSONotebook
    • JSNotebook
    • TSNotebook
  • Java
    • JavaNotebook
  • C/C++
    • CPPNotebook
    • CNotebook
    • HeaderNotebook
  • Text
    • TXTNotebook
    • MDNotebook
    • PlainNotebook
  • Web
    • HTMLNotebook
    • CSSNotebook
      • CSSStyle
  • Other
    • YMLNotebook
    • BashNotebook
  • Python
    • PYNotebook
Powered by GitBook
On this page
  • Usage
  • TXTNotebook Setup

Was this helpful?

  1. Text

TXTNotebook

extends Nodebook

"TXTNotebook" is a customized class used for .txt files.

Usage

TXTNotebook Setup

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

const textbook = new Nodebook.TXTNotebook('studies');

note(value)

Similar to addLine() but it does not automatically go to the next line.

string value: The value to add to the file.

textbook.note('Rome wasn\'t built in a day.\nScience is hard.');

erase(value, options)

Erase word(s) from the .txt file.

string value: The string to erase it from.

object options:

  • options.flag: The flag to delete in RegExp.

textbook.erase('R');
// Erases the first instance of 'R'

textbook.erase('.', { flag: 'g' });
// Erases all instances of '.'

PreviousHeaderNotebookNextMDNotebook

Last updated 4 years ago

Was this helpful?