mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature: client: load-module: migrate to ESM
This commit is contained in:
parent
9950cacad9
commit
917f585137
2 changed files with 8 additions and 8 deletions
|
|
@ -24,7 +24,7 @@ const {
|
|||
buildFromJSON,
|
||||
} = require('../common/cloudfunc');
|
||||
|
||||
const loadModule = require('./load-module');
|
||||
const {loadModule} = require('./load-module.mjs');
|
||||
|
||||
const noJS = (a) => a.replace(/.js$/, '');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
/* global CloudCmd */
|
||||
const exec = require('execon');
|
||||
const {tryToCatch} = require('try-to-catch');
|
||||
const loadJS = require('load.js').js;
|
||||
import exec from 'execon';
|
||||
import {tryToCatch} from 'try-to-catch';
|
||||
import {js} from 'load.js';
|
||||
import pascalCase from 'just-pascal-case';
|
||||
|
||||
const pascalCase = require('just-pascal-case');
|
||||
const loadJS = js;
|
||||
const noJS = (a) => a.replace(/.js$/, '');
|
||||
|
||||
/**
|
||||
* function load modules
|
||||
* @params = {name, path, func, dobefore, arg}
|
||||
*/
|
||||
module.exports = function loadModule(params) {
|
||||
export const loadModule = (params) => {
|
||||
if (!params)
|
||||
return;
|
||||
|
||||
|
|
@ -56,3 +55,4 @@ module.exports = function loadModule(params) {
|
|||
return await a.show(...args);
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue