When using task runners like Gulp and Just, as well as bundlers like webpack and rollup, you need a programming interface to add ctix.
function | option | descryption |
---|---|---|
building | TCommandBuildOptions | Execute the build command |
initializing | TCommandInitOptions | Execute the init command |
removing | TCommandRemoveOptions, TCommandBuildOptions | Execute the remove command |
const fs = require('node:fs');
const ctix = require('ctix');
const handle = async () => {
const options = ctix.parseConfig(await fs.promises.readFile('.ctirc'));
await ctix.building(options);
};
handle();
esm
import { building, parseConfig, TCommandBuildOptions } from 'ctix';
import fs from 'node:fs';
const handle = async () => {
const options = parseConfig(await fs.promises.readFile('.ctirc'));
await building(options);
};
handle();
TypeScript
import { building, parseConfig, TCommandBuildOptions } from 'ctix';
import fs from 'node:fs';
const handle = async () => {
const options = parseConfig(await fs.promises.readFile('.ctirc')) as TCommandBuildOptions;
await building(options);
};
handle();
gulp.task('ctix', async () => {
const options = parseConfig(await fs.promises.readFile('.configs/.ctirc'));
await building(options);
});