UNPKG
jin-app
Version:
latest (0.1.1)
0.1.1
0.1.0
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
A CLI app for taking simple notes without ever leaving the terminal.
jin-app
/
lib
/
utils
/
read.js
11 lines
(9 loc)
•
220 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
chalk =
require
(
'chalk'
)
const
fs =
require
(
'fs'
)
module
.
exports
=
function
read
(
path
) {
try
{
return
JSON
.
parse
(fs.
readFileSync
(path)) }
catch
(error) {
console
.
log
(chalk.
red
(error)) } }