0.1.4 • Published 8 months ago

jsontxt v0.1.4

Weekly downloads
2
License
ISC
Repository
github
Last release
8 months ago

jsontxt

Write, read, & delete JSON stored in a .txt file.

Installation

npm i jsontxt

Usage

Require module:

const jsontxt = require("jsontxt");

Write json:

const json = [{ key: "value" }, "item"];

jsontxt.write(json, { filename: "test" });

// Writes JSON in a test.txt file located in the project's root directory [default].

Read json:

const json = jsontxt.read({ filename: "test" });

console.log(json);

// [{ key: "value" }, "item"]

Delete file:

jsontxt.delete({ filename: "test" });

// Deletes test.txt file.

.txt Path

By default, PWD is the environment variable used to find a project's root directory. If it is null or undefined, or if you'd like to save the .txt file in a different location, you can define an absolute path to host the file using the JSONTXT_PATH environment variable name.

.txt Name

By default, the name assigned to the .txt file is "json". If you'd like to save the .txt file under a different name, you can define it using the JSONTXT_NAME environment variable name.

0.1.4

8 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

11 months ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

3 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago