input-from-file-json
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

input-from-file-json

create input that reads a file as JSON.

🤝 Code of Conduct: Kept 📝 License: MIT 📦 npm version 💪 TypeScript: Strict

npm i input-from-file-json
import { inputFromFileJSON } from "input-from-file-json";

await take(inputFromFileJSON, { filePath: "data.json" });

Options

inputFromFileJSON takes a single argument, filePath, of type string.

It reads the filePath from disk and returns either:

  • Error: If an error was caught reading or parsing the file
  • unknown: The result of running JSON.parse on the file's text contents

See create.bingo > Templating Engine > Runtime > Inputs for more documentation on Inputs.

Readme

Keywords

none

Package Sidebar

Install

npm i input-from-file-json

Weekly Downloads

1,152

Version

0.2.0

License

MIT

Unpacked Size

7.26 kB

Total Files

9

Last publish

Collaborators

  • joshuakgoldberg