Skip to content

Commit

Permalink
feat: added cjs entry
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Mar 4, 2021
1 parent cbf23e9 commit 0ca2e18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const fs = require('fs');

const fsExists = async filePath => fs.promises.access(
filePath,
fs.constants.F_OK,
).then(() => true, () => false);

module.exports = fsExists;
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
},
"type": "module",
"files": [
"index.cjs",
"index.js",
"index.d.ts"
],
"exports": "./index.js",
"exports": {
"import": "./index.js",
"require": "./index.cjs"
},
"scripts": {
"build": "tsc",
"lint": "eslint .",
Expand Down

0 comments on commit 0ca2e18

Please sign in to comment.