Cocy
Cocy takes your static-file content and turns it into a consumable API for your JAMstack site. The headless content management library, no matter what framework you're using.
Packages
Docs are provided per package.
| Name | Description | Package |
|---|---|---|
| cocy | main docs | |
| transform-md | Transform Markdown to HTML | |
| transform-yaml | Parse YAML files | |
| render-json | Output static JSON files |
Roadmap to v1
See the Roadmap.
Example
📦 current working directory
┣ 📂 posts
┃ ┣ 📄 Hello-World.md
┃ ┣ 📄 Second-Post.md
import Cocy from 'cocy';
import md from '@cocy/transform-md';
const cocy = new Cocy().use(md); // setup Cocy with Markdown transformer
await cocy.process(); // search for files
for (const file of cocy.files.values()) {
console.log(file.slug);
}
/*
output:
hello-world
second-post
*/
const { data } = cocy.files.getByPath('posts', 'Hello-World.md');
console.log(data.html);
/*
output:
<p>Hey!</p>
*/