open-index/open-npm huggingface dataset:
npm package: @mako-spec/cli
Description: CLI tool for validating, inspecting, and benchmarking MAKO files
Author: juanisidoro
Latest version: 0.2.0

# @mako-spec/cli

Command-line tool for the [MAKO protocol](https://github.com/juanisidoro/mako-spec) — validate, inspect, and scaffold `.mako.md` files.

## Install

```bash
npm install -g @mako-spec/cli
```

Or use with npx:

```bash
npx @mako-spec/cli validate "content/**/*.mako.md"
```

## Commands

### `mako validate <pattern>`

Validate one or more MAKO files against the spec.

```bash
mako validate "content/**/*.mako.md"
mako validate product.mako.md --strict
```

### `mako inspect <file>`

Display detailed info about a MAKO file — frontmatter, actions, links, body stats, and validation status.

```bash
mako inspect content/product.mako.md
mako inspect content/product.mako.md --json
```

### `mako init <file>`

Generate a new `.mako.md` file from a template.

```bash
mako init content/product.mako.md --type product --entity "Nike Air Max 90" --lang en
mako init content/article.mako.md --type article --entity "Getting Started with MAKO"
```

## Links

- [MAKO Spec](https://github.com/juanisidoro/mako-spec)
- [@mako-spec/js](https://www.npmjs.com/package/@mako-spec/js)
npm package: @mako-spec/js
Description: JavaScript library for parsing, generating, and serving MAKO files — the open standard for LLM-optimized web content
Author: Juan Isidoro
Latest version: 0.2.0

# mako-js

JavaScript/TypeScript library for [MAKO](https://github.com/juanisidoro/mako-spec) — the open standard for serving LLM-optimized content on the web.

## Features

- **Parse & generate** `.mako.md` files with full TypeScript types
- **CEF encode/decode** — Compact Embedding Format for HTTP header transport
- **Express middleware** — content negotiation for serving MAKO alongside HTML
- **Validator** — validate MAKO files against the spec

## Install

```bash
npm install @mako-spec/js
```

## Quick Start

```typescript
import { parseMakoFile, generateMakoFile, cefEncode, cefDecode } from '@mako-spec/js';

// Parse a .mako.md file
const file = parseMakoFile(makoContent);
console.log(file.frontmatter.entity); // "Nike Air Max 90"

// Generate a .mako.md file
const output = generateMakoFile(file);

// CEF encode/decode embeddings
const encoded = cefEncode([0.1, -0.3, 0.5, ...]);
const decoded = cefDecode(encoded, 512);
```

## Express Middleware

```typescript
import express from 'express';
import { makoMiddleware } from '@mako-spec/js/middleware/express';

const app = express();
app.use(makoMiddleware({ dir: './mako-files' }));
app.use(express.static('./html-files'));
```

## Demo

```bash
npm run demo     # Start demo server on localhost:3000
npm run benchmark # Compare HTML vs Cloudflare MD vs MAKO tokens
npm test          # Run tests
```

## License

Apache-2.0