This commit is contained in:
parent
4a57f12921
commit
822a92f6b3
10
livres.js
10
livres.js
@ -1,7 +1,7 @@
|
|||||||
const fs = require('fs')
|
import fs from 'fs'
|
||||||
const cheerio = require('cheerio')
|
import cheerio from 'cheerio'
|
||||||
const fetch = require('node-fetch')
|
import fetch from 'node-fetch'
|
||||||
const epub = require('epub-gen')
|
import Epub from 'epub-gen'
|
||||||
|
|
||||||
if (!fs.existsSync('output')) {
|
if (!fs.existsSync('output')) {
|
||||||
fs.mkdirSync('output')
|
fs.mkdirSync('output')
|
||||||
@ -70,7 +70,7 @@ const run = async (url, authors) => {
|
|||||||
book.content.push(await fetchPage(link))
|
book.content.push(await fetchPage(link))
|
||||||
}
|
}
|
||||||
|
|
||||||
new epub(book)
|
new Epub(book)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "7.32.0"
|
"eslint": "7.32.0"
|
||||||
}
|
},
|
||||||
|
"type": "module"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user