feature: cloudcmd: migrate to ESM

This commit is contained in:
coderiaser 2026-02-03 15:03:49 +02:00
parent e8a81c49ea
commit 4533a25c6f
184 changed files with 339 additions and 388 deletions

View file

@ -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;

View file

@ -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,

View file

@ -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);