Registry / web-framework / voc
library0.1.6jsnpmunverified

VOC (Very Ornate Code) is a generalized literate programming framework for JavaScript and compile-to-JS languages. It processes Markdown files, extracting code blocks delimited by triple backticks and directing them to specified output files based on hints after the opening backticks. Version 1.2.0 is stable but sees infrequent updates; it supports Node.js >=0.8 and browser usage. Unlike more modern literate programming tools, VOC focuses on simplicity and integration with existing Markdown workflows, offering a preprocessor API for custom language handlers.

npm install voc
INSTALL
IMPORT
SIG · VOC
V
voc
web-frameworkjavascriptv0.1.6
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VOC
✓ import { VOC } from 'voc'
✗ const voc = require('voc');
VOC exports a global `VOC` object in browsers; for Node.js, use the correct import path. CommonJS require works but returns an object with `run` and `add` methods.
run
✓ import { VOC } from 'voc'; VOC.run(src);
✗ const { run } = require('voc');
`run` is a method of the `VOC` object, not a named export. Destructuring from require may not work as expected.
add
✓ import { VOC } from 'voc'; VOC.add(lang, handler);
✗ const add = require('voc').add;
Similar to `run`, `add` is a method on `VOC`. Direct assignment may cause context issues.

Shows how to use VOC programmatically to process a Markdown file with code blocks.

const { VOC } = require('voc'); const fs = require('fs'); const src = fs.readFileSync('myfile.md', 'utf8'); VOC.run(src); // The output files are written to the current directory based on the markdown hints.
voc --version
Debug
Known issues
gotchaVOC relies on third-party libraries (marked.js, coffee-script.js) for browser usage; these are not bundled and must be loaded separately.
fix
Include the required scripts before using VOC in a browser.
affects: >=1.0.0
breakingVOC uses global variables for language handlers. If multiple instances are used, they share state.
fix
Avoid using VOC with multiple concurrent scripts; consider using separate scopes or a wrapper function.
affects: <2.0.0
deprecatedVersions prior to 1.0 had a different API with `VOC.parse` instead of `VOC.run`. The old API is no longer supported.
fix
Upgrade to >=1.0.0 and use `VOC.run()`.
affects: <1.0.0
gotchaOutput files are overwritten without warning. If the same output is specified in multiple code blocks, only the last one is kept.
fix
Ensure unique output paths per code block to avoid unintended overwrites.
affects: >=1.0.0
breakingNode.js engine requirement is >=0.8, which may cause issues on older systems. No support for newer ESM or async features.
fix
For modern environments, consider using a newer literate programming tool that supports ESM and async/await.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: VOC.run is not a function
Incorrect import or missing global object in browser.
fix
Ensure you have loaded VOC properly: use `const { VOC } = require('voc');` in Node or include the script tag in browser.
ReferenceError: VOC is not defined
VOC script not included or not loaded in browser.
fix
Add `<script src="path/to/voc.js"></script>` before using VOC.
Module not found: Error: Can't resolve 'voc'
VOC not installed or not present in node_modules.
fix
Run `npm install voc` in your project directory.
SyntaxError: Unexpected token 'export'
Using ES module import syntax in a CommonJS environment without transpilation.
fix
Use `const { VOC } = require('voc');` instead of `import`.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
voc — npm install voc · libregistry