Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
epub-press-js
Advanced tools
A javascript client for building books with EpubPress.
npm install --save epub-press-js
Unit Tests
npm test
Browser Test
open tests/browserTest.html
NodeJS Test
node tests/nodeTest.js
# Single build
npm run-script build
# Build + watch
npm start
<script src="node_modules/epub-press-js/build/index.js"></script>
<script>var EpubPress = window.EpubPress;</script>
const EpubPress = require('epub-press-js');
const ebook = new EpubPress({
title: 'Best of HackerNews',
description: 'Favorite articles from HackerNews in May, 2016',
sections: [
{
url: 'http://medium.com/@techBlogger/why-javascript-is-dead-long-live-php',
html: '<html><body><p>Lulz.</p></body></html>',
}
]
});
// OR
const ebook = new EpubPress({
title: 'Best of HackerNews',
description: 'Favorite articles from HackerNews in May, 2016',
urls: [
'http://medium.com/@techBlogger/why-js-is-dead-long-live-php'
]
});
ebook.publish().then(() =>
ebook.download(); // Default epub
// or ebook.email('epubpress@gmail.com')
).then(() => {
console.log('Success!');
}).catch((error) => {
console.log(`Error: ${error}`);
});
ebook.checkStatus().then((status) => {
}).catch((error) => {});
const onStatusUpdate = (status) => { console.log(status.message); };
// Adding callback
ebook.on('statusUpdate', onStatusUpdate);
// Removing callback
ebook.removeListener('statusUpdate', onStatusUpdate)
// epub-press-js updates
EpubPress.checkForUpdates().then((message) => {
console.log(message); // Undefined if no update required
});
// epub-press-chrome updates
EpubPress.checkForUpdates('epub-press-chrome', '0.9.0').then((message) => {
console.log(message);
});
new EpubPress(metadata) => ebook
metadata.sections
: Object with the url and html for a chapter.metadata.urls
: Array of urls.metadata.title
: Title for the book.metadata.description
: Description for the book.metadata.filetype
: File format to use for downloads.ebook.publish() => Promise
ebook.download(filetype) => Promise
filetype
: 'mobi'
or 'epub'
(Default 'epub'
)ebook.email(email, filetype) => Promise
filetype
: 'mobi'
or 'epub'
(Default 'epub'
)email
: Email address to deliver ebook to.ebook.checkStatus() => Promise => status
status.progress
: Percentage complete. (0 -> 100)status.message
: Status message.ebook.on('statusUpdate', (status) => {}) => callback
status.progress
: Percentage complete. (0 -> 100)status.message
: Description of current step.ebook.removeListener(eventName, callback)
eventName
: Name of the event callback
exists on.callback
: Listener to be removed.EpubPress.checkForUpdates(clientName, clientVersion) => Promise => Update Message | undefined
clientName
: EpubPress client library to check. (Default: epub-press-js
)clientVersion
: Version of client. (Default: EpubPress.VERSION
)Unknown
. You then must manually add the file extension (eg. .epub
or .mobi
)Feel free to report any other issues:
FAQs
Javascript client for building books with EpubPress.
The npm package epub-press-js receives a total of 11 weekly downloads. As such, epub-press-js popularity was classified as not popular.
We found that epub-press-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.