diff --git a/.putout.json b/.putout.json index 8fdaaf23..31c37e2f 100644 --- a/.putout.json +++ b/.putout.json @@ -6,6 +6,9 @@ "fontello.json" ], "match": { + "*.md": { + "convert-commonjs-to-esm": "on" + }, "{import.spec.js,console.js}": { "remove-skip": "off" }, diff --git a/HELP.md b/HELP.md index a380c872..1eb26b25 100644 --- a/HELP.md +++ b/HELP.md @@ -462,7 +462,7 @@ Let's consider example `user menu` works file: ```js const RENAME_FILE = 'Rename file'; -module.exports = { +export default { '__settings': { select: [ RENAME_FILE, @@ -665,9 +665,9 @@ npm i cloudcmd express socket.io -S And create `index.js`: ```js -const http = require('http'); -const cloudcmd = require('cloudcmd'); -const io = require('socket.io'); +import http from 'http'; +import cloudcmd from 'cloudcmd'; +import io from 'socket.io'; const app = require('express')(); const port = 1337; @@ -717,9 +717,9 @@ server.listen(port); Here is example with two `Config Managers`: ```js -const http = require('http'); -const cloudcmd = require('cloudcmd'); -const io = require('socket.io'); +import http from 'http'; +import cloudcmd from 'cloudcmd'; +import io from 'socket.io'; const app = require('express')(); const port = 8000; @@ -759,7 +759,7 @@ server.listen(port); If you want to enable authorization, you can pass credentials to Cloud Commander with a config. To generate a password, you can install `criton` with `npm i criton --save`, and use it (or any other way) to generate a hash of a password. ```js -const criton = require('criton'); +import criton from 'criton'; const algo = 'sha512WithRSAEncryption'; // default // you can generate a hash dynamically diff --git a/README.md b/README.md index 409c01e5..7fc8af99 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ npm i cloudcmd express socket.io -S And create `index.js`: ```js -const http = require('http'); -const cloudcmd = require('cloudcmd'); -const io = require('socket.io'); +import http from 'http'; +import cloudcmd from 'cloudcmd'; +import io from 'socket.io'; const app = require('express')(); const port = 1337;