Skip to content

Commit

Permalink
Load package.json using require
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeschastny committed Oct 11, 2023
1 parent 657b8ce commit 806daee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const path = require('path');
const fs = require('fs');
const { CWebp, DWebp } = require('./webp');

const pkg = path.resolve(__dirname, '../package.json');
const { version } = JSON.parse(fs.readFileSync(pkg, 'utf8'));
const { version } = require('../package.json');

module.exports = Object.assign(CWebp, { CWebp, DWebp, version });

0 comments on commit 806daee

Please sign in to comment.