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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@issadicko/kodi-script

v0.1.3

Published

A lightweight, embeddable scripting language for JavaScript/TypeScript applications

Readme

KodiScript

A lightweight, embeddable scripting language for JavaScript/TypeScript applications.

npm version

📖 Full Documentation: docs-kodiscript.dickode.net

Installation

npm install @issadicko/kodi-script
# or
yarn add @issadicko/kodi-script
# or
pnpm add @issadicko/kodi-script

Usage

Simple Execution

import { KodiScript } from '@issadicko/kodi-script';

const result = KodiScript.run(`
  let name = "World"
  print("Hello " + name)
`);

console.log(result.output); // ['Hello World']

Variable Injection

const result = KodiScript.run(`
  let greeting = "Hello " + user.name
  let status = user?.active ?: "offline"
  print(greeting)
`, {
  user: { name: 'Alice', active: true }
});

Builder Pattern

const result = KodiScript.builder(`
  let greeting = customGreet("World")
  print(greeting)
`)
  .withVariable('version', '1.0')
  .registerFunction('customGreet', (name) => `Hello, ${name}!`)
  .execute();

Features

  • Variables: let name = "value"
  • Null-safety: user?.name, value ?: "default"
  • Control flow: if/else, return
  • Native functions: String, Math, JSON, Crypto, Arrays
  • Extensible: Register your own native functions
  • TypeScript support: Full type definitions included

🔌 Extensibility

KodiScript is designed to be extensible. You can enrich the language by adding your own native functions, allowing scripts to interact with your system.

Custom Functions

const result = KodiScript.builder(`
  let greeting = greet("World")
  let price = calculatePrice(100, 0.2)
  print(greeting + " - Total: $" + price)
`)
  .registerFunction('greet', (name) => `Hello, ${name}!`)
  .registerFunction('calculatePrice', (amount, taxRate) => amount * (1 + taxRate))
  .execute();

Express.js Integration

import express from 'express';
import { KodiScript } from '@issadicko/kodi-script';

const app = express();

// Create a script engine with business functions
function createScriptEngine(context: Record<string, unknown>) {
  return KodiScript.builder('')
    .withVariables(context)
    .registerFunction('fetchUser', async (id) => {
      // Call your database
      return { id, name: 'Alice', tier: 'gold' };
    })
    .registerFunction('calculateDiscount', (tier, amount) => {
      const discounts = { gold: 0.2, silver: 0.1, bronze: 0.05 };
      return amount * (discounts[tier] || 0);
    })
    .registerFunction('sendEmail', (to, subject, body) => {
      // Send email via your service
      console.log(`Email sent to ${to}`);
      return true;
    });
}

app.post('/api/execute', (req, res) => {
  const { script, context } = req.body;
  const engine = createScriptEngine(context);
  const result = engine.withSource(script).execute();
  res.json(result);
});

This allows your users to write powerful scripts while you maintain control over exposed functionality.

Native Functions

String

print, toString, toNumber, length, substring, toUpperCase, toLowerCase, trim, replace, split, join, contains, startsWith, endsWith, indexOf

Math

abs, floor, ceil, round, min, max, pow, sqrt, sin, cos, tan, log, log10, exp

Random

random, randomInt, randomUUID

JSON/Encoding

jsonParse, jsonStringify, base64Encode, base64Decode, urlEncode, urlDecode

Arrays

size, first, last, slice, reverse, sort, sortBy

Types

typeOf, isNull, isNumber, isString, isBool

Crypto

md5, sha1, sha256

Date/Time

now, date, time, datetime, timestamp, formatDate, year, month, day, hour, minute, second, dayOfWeek, addDays, addHours, diffDays

Syntax

// Variables
let name = "Kodi"
let version = 1.0

// Null-safety
let status = user?.active ?: "offline"

// Conditions
if (version > 1.0) {
  print("Modern version")
} else {
  print("Legacy version")
}

// Return
return "result"

// Arrays and Objects
let arr = [1, 2, 3]
let obj = { name: "Alice", age: 30 }

Other Implementations

| Language | Package | |----------|---------|
| Kotlin | Maven Central | | Go | pkg.go.dev | | Dart | pub.dev |

License

MIT