Skip to content

Commit 917f585

Browse files
committed
feature: client: load-module: migrate to ESM
1 parent 9950cac commit 917f585

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

client/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const {
2424
buildFromJSON,
2525
} = require('../common/cloudfunc');
2626

27-
const loadModule = require('./load-module');
27+
const {loadModule} = require('./load-module.mjs');
2828

2929
const noJS = (a) => a.replace(/.js$/, '');
3030

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
'use strict';
2-
31
/* global CloudCmd */
4-
const exec = require('execon');
5-
const {tryToCatch} = require('try-to-catch');
6-
const loadJS = require('load.js').js;
2+
import exec from 'execon';
3+
import {tryToCatch} from 'try-to-catch';
4+
import {js} from 'load.js';
5+
import pascalCase from 'just-pascal-case';
76

8-
const pascalCase = require('just-pascal-case');
7+
const loadJS = js;
98
const noJS = (a) => a.replace(/.js$/, '');
109

1110
/**
1211
* function load modules
1312
* @params = {name, path, func, dobefore, arg}
1413
*/
15-
module.exports = function loadModule(params) {
14+
export const loadModule = (params) => {
1615
if (!params)
1716
return;
1817

@@ -56,3 +55,4 @@ module.exports = function loadModule(params) {
5655
return await a.show(...args);
5756
};
5857
};
58+

0 commit comments

Comments
 (0)