Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Cocy

CI status Code coverage npm version

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 npm version
transform-md Transform Markdown to HTML npm version
transform-yaml Parse YAML files npm version
render-json Output static JSON files npm version

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>
*/

About

Transform your content into an API.

Topics

Resources

Stars

Watchers

Forks

Languages