combo
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Combo

Combo lets you build static APIs.

This is achieved by processing a given data source into a folder structure containing JSON files (without extensions). This folder structure can be hosted on services such as GitLab Pages.

Name

The usefulness of this library comes from its ability to combine raw data with transformations in order to create useful, static APIs.

Notice

Combo is in early development. It will contain bugs and is subject to change at any time.

Installation

npm install combo

Example

import Combo from "combo";

type DataSource = {
  id: string;
  title: string;
}[];

const api = new Combo<DataSource>();

const v1 = api.addVersion("v1");
v1.addRouteFunction("list", (data) => {
  return data.reduce((obj, { id, title }) => {
    return { ...obj, [id]: title };
  }, {});
});

api.build([
  { id: "001", title: "Test 001" },
  { id: "002", title: "Test 002" },
  { id: "003", title: "Test 003" },
]);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.3
    1
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i combo

Weekly Downloads

1

Version

0.1.3

License

Zlib

Unpacked Size

26 kB

Total Files

15

Last publish

Collaborators

  • funkeh