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

training-data-gen

v1.0.0

Published

Small JS tool for generating training data using OpenAI's API compatible endpoints. Works for local LLMs as well. #localLLAMA

Readme

Instructions

  1. Install package: npm install training-data-gen --save.
  2. Make sure in your package.json, you are using "type": "module".
  3. Create a file index.js and import getTrainingDataGen. import { getTrainingDataGen } from "training-data-gen";
  4. Use getTrainingDataGen to get the generator function.
const generate = await getTrainingDataGen({
    systemMsg: `<instructions for generating training data>`,
    trainingDataSchema: <schema of the training data>,
});
  1. Execute generate fn with different training data set usecases.
generate([
    `Generate a training data for X usecase`.
    `Generate a training data for Y usecase`.
]);

Full Code

import { getTrainingDataGen } from "training-data-gen";

const generate = await getTrainingDataGen({
    systemMsg: `You are an expert AI training data generator. Your task is to create high-quality training examples for fine-tuning a small language model (0.6B parameters) to apply code changes based on specific instructions.

## Your job is to generate unique training example with these fields:
- "input": <<Instructions for -> detail of the input that would be provided by the user>>.
- "change_instructions": <<Instructions for -> how input would be augumented>>
- "output": <<Instructions for -> the final>>.

## Each change instruction should be:
<<..Details of the change instructions goes here..>>

## Response Format:
{
  "input": "<some example input>",
  "change_instructions": "<some example change instructions>",
  "output": "<some example output>"
}
`,
trainingDataSchema: {
    type: "object",
    properties: {
        // following is an example schema and can be changed based on the training usecase.
        input: {
            type: "string",
            description: "<details of the input content>"
        },
        change_instructions: {
            type: "array",
            items: {
                type: "string"
            },
            description: "<details of the change instructions>"
        },
        output: {
            type: "string",
            description: "<details of the output>"
        },
        trainingDataIndex: {
            type: "number",
            description: "The index of the training data item in the dataset. Index starts from 0."
        }
    },
    required: ["input", "change_instructions", "output", "trainingDataIndex"]
},
});

generate([
    `Generate a training data for X usecase`.
    `Generate a training data for Y usecase`.
    ...
]);

License

This project is dual-licensed:

  • Non-Commercial Use: Free under the PolyForm Noncommercial License.
  • Commercial Use: Requires a paid commercial license.

If you want to use this project in a commercial product, SaaS, or paid offering, please contact:

📧 [email protected]