-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
119 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
# epubook | ||
# @epubook/core | ||
|
||
A Node EPUB generation library. | ||
|
||
It will support the generation of the [latest epub standard](https://www.w3.org/TR/epub-33/) (3.3). | ||
The fundamental module of [epubook](https://github.com/yjl9903/epubook) for generating EPUB books. | ||
|
||
> 👷♂️ Still work in progress. | ||
## Installation | ||
|
||
```bash | ||
npm i @epubook/core | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import { Epubook } from '@epubook/core' | ||
|
||
const book = new Epubook({ | ||
title: 'Test Book', | ||
date: new Date('2023-02-01T11:00:00.000Z'), | ||
lastModified: new Date('2023-02-26T11:00:00.000Z'), | ||
creator: 'XLor', | ||
description: 'for test usage', | ||
source: 'imagine' | ||
}) | ||
|
||
// ... | ||
|
||
await book.writeFile('./test.epub') | ||
``` | ||
|
||
## License | ||
|
||
MIT License © 2023 [XLor](https://github.com/yjl9903) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
import { defineBuildConfig } from 'unbuild'; | ||
|
||
export default defineBuildConfig({ | ||
entries: [ | ||
'src/index', | ||
], | ||
entries: ['src/index', 'src/cli.ts'], | ||
declaration: true, | ||
clean: true, | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
}); | ||
emitCJS: true | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
import('./dist/cli.mjs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { breadc } from 'breadc'; | ||
|
||
import { version } from '../package.json'; | ||
|
||
const cli = breadc('epubook', { | ||
version, | ||
description: 'Generate EPUB books' | ||
}); | ||
|
||
cli.command('').action(() => {}); | ||
|
||
cli.run(process.argv.slice(2)).catch((err) => console.error(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export function hello() { | ||
return 'world'; | ||
} | ||
export * from '@epubook/core'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.