An open API service indexing awesome lists of open source software.

https://github.com/atomicojs/scaffold


https://github.com/atomicojs/scaffold

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

## @atomico/scaffold

CLI that generates files from markdown documents

### Install

```bash
npm i @atomico/scaffold
```

## use from package.json#scripts

Add script to package.json

```json
{
"scripts": {
"create-component": "scaff template/component-jsx src"
}
}
```

## use from npx

```bash
scaff template/component-jsx src
```

## Markdown

The files are created according to the markdown file associated with the CLI, all the code blocks that declare the path will be created only if the document does not exist, example:

````md
---
{
data: { name: "Upper Cod" },
questions: [{ type: "text", name: "name", message: "Component name?" }],
}
---

## bla bla..

```js tests/build/<>.js
const data = {"<>":10};
const <> = 10;
const <> = 10;
```

Bla bla..

```css tests/build/<>.css
:host {
display: block;
}
```
````

The CLI uses [Prompts](https://www.npmjs.com/package/prompts) for the use of questions