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

english-script

v0.0.9

Published

Embed natural language in your code

Downloads

9

Readme

english-script

Embed natural language in your code.

Allow me to completely take out of context this great Djikstra essay:

It may be illuminating to try to imagine what would have happened if, right from the start our native tongue would have been the only vehicle for the input into and the output from our information processing equipment...

-- Edsger W.Dijkstra

Usage

npm i english-script
const f = await makeFunction({
  apiKey: "your openai key here",
  iterations: 4, // How many "turns" are given for the AI to get the function right.
  description: "determine if prime",
  testCases: [
    [1, false], // By definition
    [2, true],
    [4, false],
  ],
});
[53, 44].map(f); // Gives back [true, false]

Implementation details

  1. Caching (https://github.com/uriva/rmmbr) is used to avoid repetitive slow/expensive calls to OpenAI.
  2. The generated code is checked for side effects (e.g. network calls or external dependencies), to make sure it is safe to run.
  3. The generated code is tested against your provided test cases.

So what is this?

Background

We can now generate code with fairly good quality, depending on the task, using LLMs.

The common developer goes through this cycle:

  1. Prompt LLM to get some code to do some task
  2. Copy the code into their IDE
  3. Read it to make sure it makes sense
  4. Write some tests and running them to make sure it works as expected
  5. Commit the code into the repo

Argument

Committing code generated by a machine doesn't feel right because it's kind of like committing a compiled binary.

If I compile some code and save the binaries, I now have in my repo two things which are coupled together, and it's unclear if the versions match, how they match, which derives from which, and therefore it becomes unclear which I need to iterate on in order to improve.

This is why it's a common practice to commit only the "topmost" work, i.e. the one others derive from. This has always been high level code, until now. We've now reached the point where at least in some cases the topmost form is a prompt in natural language description, and so we should commit that form instead.

Furthermore most of what LLMs generating code are really good at is code that already exists in some form in the web, in the form of libraries or code examples in stackoverflow. So it's unlikely that adding generated code into our repo will contribute any concrete innovation, rather than provide more duplication.

Problem

How do we commit natural language alongside code and iterate on it, so that we can avoid duplication, benefit from the LLMs incredible abilities and have a workflow that makes sense?

Solution

english-script is a js library that allows you to embed natural language descriptions of pure functions inside your code seamlessly. It calls an LLM API in the background to get code and replace it on the fly.