UNPKG
npm-install-size
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.1
1.0.0
Check the install size of any NPM package before installing it.
npm-install-size
/
lib
/
config.js
12 lines
(11 loc)
•
306 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
fs
from
'fs/promises'
;
import
path
from
'path'
;
export
async
function
loadConfig
(
) {
const
configPath = path.
join
(process.
cwd
(),
'.npm-install-sizerc'
);
try
{
const
content =
await
fs.
readFile
(configPath,
'utf8'
);
return
JSON
.
parse
(content); }
catch
{
return
{}; } }