@l8n/fs
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

fs

file handling

Install

npm install @l8n/fs --save-dev
yarn add @l8n/fs --dev

Usage

import { insertLine, removeLine, updateLine, readFile } from '@l8n/fs';

const filename = './test/a.txt';
// insert line: line number optional
// if there is no line number, then the end of the file append.
insertLine(filename, 'test99', 9);

// remove line: exact match
removeLine(filename, 'test99');

// update line: exact match
updateLine(filename, 'old text', 'new text');

// returns array
readFile(filename);

Package Sidebar

Install

npm i @l8n/fs

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

8.11 kB

Total Files

8

Last publish

Collaborators

  • l8n