UNPKG
synp
Version:
latest (1.9.14)
1.9.14
1.9.13
1.9.10
1.9.9
1.9.8
1.9.7
1.9.6
1.9.5
1.9.4
1.9.3
1.9.2
1.9.1
1.9.0
1.8.3
1.8.2
1.8.1
1.8.0
1.7.1
1.7.0
1.6.0
1.5.0
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
Convert yarn.lock to package-lock.json and vice versa
github.com/imsnif/synp
imsnif/synp
synp
/
util
/
read.js
12 lines
(8 loc)
•
227 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
const
{ readFileSync } =
require
(
'fs'
)
module
.
exports
= {
read
(path, skipParse) {
const
contents =
readFileSync
(path).
toString
(
'utf-8'
)
return
skipParse ? contents :
JSON
.
parse
(contents.
trim
()) } }