Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rayzr522/yamore
A simple preprocessor that adds more functionality to YAML in the form of preprocessing.
https://github.com/rayzr522/yamore
Last synced: 26 days ago
JSON representation
A simple preprocessor that adds more functionality to YAML in the form of preprocessing.
- Host: GitHub
- URL: https://github.com/rayzr522/yamore
- Owner: rayzr522
- License: mit
- Created: 2023-07-20T01:26:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-20T02:27:58.000Z (over 1 year ago)
- Last Synced: 2023-07-20T02:33:56.905Z (over 1 year ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yamore
[![npm version](https://badge.fury.io/js/yamore.svg)](https://npmjs.com/package/yamore)
> A simple preprocessor that adds more functionality to YAML in the form of preprocessing.
## usage
```js
// .github/process.js
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { transformFile } from 'yamore'const baseDir = path.dirname(fileURLToPath(import.meta.url))
const templatesDir = path.join(baseDir, 'workflow-templates')
const outDir = path.join(baseDir, 'workflows')for (const template of await fs.readdir(templatesDir)) {
if (!template.endsWith('.yml')) continue
console.log(`🤔 processing ${template}...`)
transformFile(path.join(templatesDir, template), path.join(outDir, template))
console.log(`✅ processed ${template}!`)
}
```