git.iko.soy/typeable/remark-validate-links
on main help sign in
Use `fs` instead of `require` to load `package.json`s
commitd86b38a6989615553b6c320ba4e5940a4a240351 authorTitus Wormer <tituswormer@gmail.com> dateMon 21 Aug 2017, 12:39 (9 years ago) parenta5c5644
1 file changed+1−2
index.js+1−2
index.js+1−2
@@ -32,8 +32,7 @@ function attacher(options, fileSet) {
3232 if (!repo) {
3333 try {
3434 pack = fileSet.files[0].cwd;
35− // eslint-disable-next-line import/no-dynamic-require
36− pack = require(path.resolve(pack, 'package.json'));
35+ pack = JSON.parse(fs.readFileSync(path.resolve(pack, 'package.json')));
3736 } catch (err) {
3837 pack = {};
3938 }