Automate repetitive manipulations with your codebase. Or create a codebase generator. Or something else.
- Both API and CLI usage
- Human readable
ao-down
format - Manipulation with files
- Installing and uninstalling npm packages
yarn global add makreo
# OR
npm install -g makreo
makreo --help
Usage
$ makreo [path to your macros directory]
Examples
$ makreo ~/Documents/Macros
yarn add -D makreo
# OR
npm install -dev makreo
// makreo.js contents
require('makreo')('your/macro/directory')
3. Write some macros and add them to this directory
node makreo.js
Tip: You may also add it to your npm scripts!
All makreo
macros must be named as <name>.macro.md
.
Macros are written in the ao-down
format:
Everything not matching the syntax is considered a comment
// Action parameter is required by makreo
`Action:` Action name
// Other parameters depend on Action
`First parameter:` Inline value
`Second parameter:`
```text
^
| Specifying the language isn't required
Multiline value
```
`Third parameter:`
---
`Action:` Another action name
...
Parameter | Description |
---|---|
target | Path to the file(s) you want to modify. Supports wildcards. |
regex | This defines where the Content will be placed (see Position ). |
position | Is either before or after . Defines whether the Content is placed before or after the RegEx match. |
content | The text you want to insert. |
Parameter | Description |
---|---|
Target | Path to the file(s) you want to modify. Supports wildcards. |
RegEx | This defines what should be replaced by Content . |
Content | The text you want to replace RegEx match by. |
Parameter | Description |
---|---|
Path | Path to the directory you want to create a file in. Supports wildcards. |
Filename | A name for your file |
Content | The text you want to insert into the new file |
Parameter | Description |
---|---|
Path | Path to the directory you want to create a folder in. Supports wildcards. |
Folder name | A name for your folder |
Parameter | Description |
---|---|
Package | Name of the package you want to install from npm. |
Project root | Defines where to run the install comand. |
Uses yarn if lock present in
Project root
.
Parameter | Description |
---|---|
Package | Name of the package you want to uninstall. |
Project root | Defines where to run the uninstall comand. |
Uses yarn if lock present in
Project root
.