Skip to content

Commit

Permalink
feat: add nodenext compatibility (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Feb 20, 2023
1 parent 6412a92 commit 0476264
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# should improve installation performance slightly
*
!src/index.js
!src/index.d.ts
!src/lib/win32/unrtf*/bin/**
!src/lib/win32/unrtf*/contrib/**/COPYING
!src/lib/win32/unrtf*/contrib/**/README
!src/lib/win32/unrtf*/contrib/**/README
!types/index.d.ts
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"wpml"
],
"main": "src/index.js",
"types": "types/index.d.ts",
"repository": "git+https://github.com/Fdawgs/node-unrtf.git",
"homepage": "https://github.com/Fdawgs/node-unrtf",
"bugs": {
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const execFileAsync = promisify(execFile);
* @param {object} acceptedOptions - Object containing options that a binary accepts.
* @param {object} options - Object containing options to pass to binary.
* @param {string=} version - Semantic version of binary.
* @returns {Array|Error} Array of CLI arguments or Error object if invalid arguments provided.
* @returns {Array<string>} Array of CLI arguments.
* @throws {Error} If invalid arguments provided.
*/
function parseOptions(acceptedOptions, options, version) {
const args = [];
Expand Down Expand Up @@ -212,6 +213,5 @@ class UnRTF {
}
}

module.exports = {
UnRTF,
};
module.exports.UnRTF = UnRTF;
module.exports.default = UnRTF;
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"include": ["src/index.js"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"allowJs": true,
"outDir": "types",
"strict": true
}
}
1 change: 1 addition & 0 deletions src/index.d.ts → types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export default UnRTF;
export class UnRTF {
/**
* @param {string=} binPath - Path of UnRTF binary.
Expand Down

0 comments on commit 0476264

Please sign in to comment.