mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature: cloudcmd: migrate to ESM
This commit is contained in:
parent
e8a81c49ea
commit
4533a25c6f
184 changed files with 339 additions and 388 deletions
|
|
@ -1,14 +1,14 @@
|
|||
'use strict';
|
||||
import {callbackify} from 'node:util';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import {dirname} from 'node:path';
|
||||
import pullout from 'pullout';
|
||||
import ponse from 'ponse';
|
||||
import {read} from 'redzip';
|
||||
import root from '../root.js';
|
||||
import parse from './worker.js';
|
||||
|
||||
const {callbackify} = require('node:util');
|
||||
|
||||
const pullout = require('pullout');
|
||||
const ponse = require('ponse');
|
||||
const {read} = require('redzip');
|
||||
|
||||
const root = require('../root');
|
||||
|
||||
const parse = require('./worker');
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const isString = (a) => typeof a === 'string';
|
||||
|
||||
// warm up
|
||||
|
|
@ -16,7 +16,7 @@ parse('');
|
|||
|
||||
const DIR_ROOT = `${__dirname}/../../`;
|
||||
|
||||
module.exports = callbackify(async (name, rootDir, request) => {
|
||||
export default callbackify(async (name, rootDir, request) => {
|
||||
check(name, request);
|
||||
|
||||
const {method} = request;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {tryToCatch} from 'try-to-catch';
|
|||
import test from 'supertape';
|
||||
import serveOnce from 'serve-once';
|
||||
import markdown from './index.js';
|
||||
import cloudcmd from '../cloudcmd.mjs';
|
||||
import cloudcmd from '../cloudcmd.js';
|
||||
|
||||
const config = {
|
||||
auth: false,
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
import createMarkdownIt from 'markdown-it';
|
||||
|
||||
const markdownIt = require('markdown-it')();
|
||||
const markdownIt = createMarkdownIt();
|
||||
|
||||
module.exports = (a) => markdownIt.render(a);
|
||||
export default (a) => markdownIt.render(a);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue