Socket
Socket
Sign inDemoInstall

ebookor

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebookor

grab content from web to make ebook such as *.epub,it needs a uri and auto grab all related resource then let user choose which will go into ebook. it can set basic information for ebook such as cover,title,author and so on.


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

#ebookor auto grab content from web including related resource such as css,image,links and so on to make ebook for epub.

Install

npm install ebookor

Quick start

var ebookor=require('ebookor');

// optional
// ebookor.useLanguage({
//   var message={
//     'rendder file failed':'渲染文件失败',
//     'is loading':'正在下载',
//   	'all resource is loaded':'所有资源文件已下载完',
//   	'epub maked success':'epub文件已生成',
//   	'is copying related files':'正在操作相关文件',
//   	'is reading config and edit opt and ncx':'读取配置编辑epub配置文件',
//   	'lack of base information about downloaded resources':'没找到下载的资源文件',
//   	'we need some time to pack files into epub,plaease wait for a momenet':'正在生成电子书,稍等片刻'
//   };
// });

// optional
// for example you are grabing cur url,and thr url page include other url page,we need tell progama wether grap the other url page,defualt is like this: url=http://javascript.ruanyifeng.com/advanced/fsm.html,nextUrl=http://javascript.ruanyifeng.com/advanced/ecmascript6.html,then return true,if nextUrl=http://javascript.ruanyifeng.com/test/a.html,return false
// ebookor.setRule(function(url,nextUrl){
//   return true;
// });

var monitor=ebookor.start({
  uri:'uri'//set one available resource uri,http or https is ok
});

// monintor progress
monitor.on('message',function(msg){
  console.log(msg.type);//update,error,loaded,finished
  switch (msg.type) {
    case 'update':
      console.log(msg.name+' is loading');
      break;
    case 'loaded':
      console.log('all is loaded');
      var htmls=ebookor.getHtmlList();//we can preview all htmls loaded
      ebookor.epubConfig(config);//we can set basic information for making epub.
      ebookor.makeEpub();//start to make epub using htmls loaded
      break;
    case 'finished':
      console.log(monitor.file+'can be downloaded');
      break;
    case 'error':
      console.log(monitor.msg);
      break;
    default:
      console.log(monitor.msg);
  }
});
tips

if you have problem with it ,let me know,my email: cuc_ygh@163.com,thanks!

Keywords

FAQs

Package last updated on 18 Jan 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc