From 822a92f6b3e068ff6d1e2044471d7ae5fce92b8a Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 24 Aug 2021 23:41:04 +0200 Subject: [PATCH] Use new imports from ES6 modules --- livres.js | 10 +++++----- package.json | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/livres.js b/livres.js index c521ed8..bfc331f 100644 --- a/livres.js +++ b/livres.js @@ -1,7 +1,7 @@ -const fs = require('fs') -const cheerio = require('cheerio') -const fetch = require('node-fetch') -const epub = require('epub-gen') +import fs from 'fs' +import cheerio from 'cheerio' +import fetch from 'node-fetch' +import Epub from 'epub-gen' if (!fs.existsSync('output')) { fs.mkdirSync('output') @@ -70,7 +70,7 @@ const run = async (url, authors) => { book.content.push(await fetchPage(link)) } - new epub(book) + new Epub(book) }) } diff --git a/package.json b/package.json index 0f67919..71970e1 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,6 @@ }, "devDependencies": { "eslint": "7.32.0" - } + }, + "type": "module" }