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
/
write.js
11 lines
(9 loc)
•
232 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
write
(
path, data
) { fs.
writeFileSync
(path,
JSON
.
stringify
(data),
err
=>
{
if
(err) {
console
.
log
(chalk.
red
(err)) } }) }