1.0.0 • Published 9 months ago

@decky.fx/node-repl v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

Node-REPL

What is this?

This is a simple nodejs server, it has zero dependancy!

Features

  • zero dependancy
  • basic command handler
  • basic arguments handler

Requirement

  • nvm
  • nodejs >= v20.17.0
  • yarn

Latest Version

1.0.0

Usage

Install with

npm i @decky.fx/node-repl

See example folder

import repl, { command } from "../dist/index";

async function add(...inputs: (string | number)[]) {
  return inputs.reduce((sum, cur) => {
    return sum + typeof cur === "number" ? cur : 0;
  }, 0);
}

command("add", async (args) => {
  const result = await add(...args.args);
  return true;
});

repl();

Todos

  • Next ideas
1.0.0

9 months ago