Skip to content

Commit

Permalink
fix(module): force version bumping
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored Apr 7, 2022
1 parent 3290af5 commit 76c6efa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,20 @@ npm i jw-epub-parser
import { loadEPUB } from 'jw-epub-parser';

const epubJW = await loadEPUB('/path/to/file.epub');
```

If you want to use this module in a node apps, first do the following:

- Install jsdom and global-jsdom

```js
npm i jsdom global-jsdom
```

console.log('epub schedule content:', epubJW);
- Enables DOM in Node.js using global-jsdom

```js
import 'global-jsdom/register';
```

### loadEPUB(epubData)
Expand Down
37 changes: 20 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"chai": "^4.3.6",
"global-jsdom": "^8.4.0",
"jsdom": "^19.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^9.2.0",
"rollup": "^2.69.0"
},
Expand Down
8 changes: 3 additions & 5 deletions test/index.test.cjs → test/index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require('jsdom-global')();
global.DOMParser = window.DOMParser;

const { expect } = require('chai');
const { loadEPUB } = require('../dist/index.cjs');
import 'global-jsdom/register';
import { expect } from 'chai';
import { loadEPUB } from '../dist/index.cjs';

const expData = {
mwbYear: '2021',
Expand Down

0 comments on commit 76c6efa

Please sign in to comment.