npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hemmer-io/jcl

v1.2.0

Published

Jack-of-All Configuration Language - A general-purpose configuration language with powerful built-in functions

Downloads

180

Readme

JCL Node.js Bindings

Node.js/JavaScript/TypeScript bindings for the Jack-of-All Configuration Language (JCL).

Installation

npm install @hemmerio/jcl
# or
yarn add @hemmerio/jcl

Usage

JavaScript

const jcl = require('@hemmerio/jcl');

// Evaluate JCL code
const config = jcl.eval(`
  name = "my-app"
  version = "1.0.0"
  ports = [80, 443, 8080]
  database = (
    host = "localhost",
    port = 5432
  )
`);

console.log(config.name);        // "my-app"
console.log(config.ports);       // [80, 443, 8080]
console.log(config.database);    // { host: 'localhost', port: 5432 }

TypeScript

import * as jcl from '@hemmerio/jcl';

interface Config {
  name: string;
  version: string;
  ports: number[];
  database: {
    host: string;
    port: number;
  };
}

const config = jcl.eval(`
  name = "my-app"
  version = "1.0.0"
  ports = [80, 443, 8080]
  database = (
    host = "localhost",
    port = 5432
  )
`) as Config;

console.log(config.name);        // Type-safe!
console.log(config.database.host);

API Reference

parse(source: string): string

Parse JCL source code and return a summary.

const result = jcl.parse('name = "my-app"');
console.log(result); // "Parsed 1 statements"

eval(source: string): object

Evaluate JCL source code and return all defined variables.

const config = jcl.eval(`
  env = "production"
  debug = false
`);
console.log(config); // { env: 'production', debug: false }

evalFile(path: string): object

Load and evaluate a JCL file.

const config = jcl.evalFile('./config.jcf');
console.log(config);

format(source: string): string

Format JCL source code.

const formatted = jcl.format('x=1+2\ny   ="hello"');
console.log(formatted);
// Output:
// x = 1 + 2
// y = "hello"

lint(source: string): LintIssue[]

Lint JCL source code and return issues.

interface LintIssue {
  rule: string;
  message: string;
  severity: 'error' | 'warning' | 'info';
  suggestion?: string;
}
const issues = jcl.lint(`
  x = 1
  unused_var = 2
  y = x + 1
`);

for (const issue of issues) {
  console.log(`${issue.severity}: ${issue.message}`);
}

Use Cases

VS Code Extension

import * as jcl from '@hemmerio/jcl';
import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {
  // Format on save
  context.subscriptions.push(
    vscode.languages.registerDocumentFormattingEditProvider('jcl', {
      provideDocumentFormattingEdits(document) {
        const text = document.getText();
        const formatted = jcl.format(text);
        // ... apply edits
      }
    })
  );

  // Diagnostics (linting)
  const diagnostics = vscode.languages.createDiagnosticCollection('jcl');
  context.subscriptions.push(diagnostics);

  function updateDiagnostics(document: vscode.TextDocument) {
    const issues = jcl.lint(document.getText());
    const vscodeDiagnostics = issues.map(issue => {
      // Convert to VS Code diagnostic
    });
    diagnostics.set(document.uri, vscodeDiagnostics);
  }
}

Build Tool / Webpack Plugin

const jcl = require('@hemmerio/jcl');

class JclWebpackPlugin {
  apply(compiler) {
    compiler.hooks.beforeCompile.tapAsync('JclWebpackPlugin', (params, callback) => {
      const config = jcl.evalFile('./build.jcf');
      // Use config to modify webpack configuration
      callback();
    });
  }
}

Express.js Configuration

const express = require('express');
const jcl = require('@hemmerio/jcl');

const config = jcl.evalFile('./server.jcf');

const app = express();
app.listen(config.port, () => {
  console.log(`Server running on port ${config.port}`);
});

Configuration Management

const jcl = require('@hemmerio/jcl');

// Load environment-specific config
const env = process.env.NODE_ENV || 'development';
const config = jcl.eval(`
  import * from "./config/base.jcf"
  import * from "./config/${env}.jcf"

  # Override with environment variables
  port = env("PORT", port)
  database_url = env("DATABASE_URL", database_url)
`);

module.exports = config;

Type Conversions

JCL types are automatically converted to JavaScript types:

| JCL Type | JavaScript Type | |----------|-----------------| | string | string | | int | number | | float | number | | bool | boolean | | null | null | | list | Array | | map | Object | | function | string (displays as "<function>") |

Building from Source

# Install dependencies
npm install

# Build
npm run build

# Build release
npm run build-release

Requirements

  • Node.js >= 12
  • Rust toolchain (for building from source)

License

MIT OR Apache-2.0