un-cc
v1.0.2
Published
<p align="center"> <a href="https://www.npmjs.com/package/un-cc" target="_blank" rel="noopener noreferrer"> <img src="https://api.iconify.design/codicon:terminal-cmd.svg?color=%23b3ff75" alt="logo" width='100'/></a> </p>
Downloads
13
Readme
Get started
# npx
npm install un-cc@latest -D
Usage
import { createComponent } from 'un-cc';
createComponent({
staticComponentDir: 'src',
componentDirectoryStr: ['components'],
templatesDir: 'scripts/templates',
transform(content, componentName) {
return content.replaceAll('COMPONENT_NAME', 'TestComponent');
},
});
API
type CreateComponentOptions = {
staticComponentDir: string;
componentDirectoryStr: string[];
templatesDir: string;
transform?: (content: string, componentName: string) => string;
transformFileName?: (filename: string, componentName: string) => string;
transformExecFile?: (componentName: string) => string;
};