New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sme.up/kokos-template-node

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sme.up/kokos-template-node

Node.js Kokos Template

  • 0.0.15
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

Kokos Template Node

Kokos Template Node is the template for creating a micro executor based on Node.js with typescript support. It encapsulate all standard features such as:

  • types
  • interfaces
  • http support
  • serverless support
  • hot reload for development environment
  • build

Getting Started

Kokos Template Node has an initialization script callable using NPX.

npx @sme.up/kokos-template-node init [PROJECT_NAME]

The previous command create a folder called [PROJECT_NAME] and provides the first example.

Now you can install all dependencies:

npm install

and run in development mode (hot reload)

npm run dev:restapi

Create a Service

Kokos Node.js service is a Javascript Object based on KokosService interface located under src/services folder

services/[SERVICE_NAME].ts

import { KokosService } from "@sme.up/kokos-template-node";

const [SERVICE_NAME]: KokosService = {
    methods: {
        "HEL.WOR": helloWorld
    }
}

function helloWorld(fun: Fun, context: ExecutionContext): SmeupTree {
  const tree: SmeupTree = {
    type: SmeupDataStructureType.SmeupTree,
    children: [
      {
        children: [],
        content: {
          tipo: "",
          parametro: "",
          codice: "",
          testo: "Hello World",
        },
      },
    ],
  };
  return tree;
}

The service exposes method called HEL.WOR callable by FUN: F(TRE;[SERVICE_NAME];HEL.WOR)

Build

To properly build the micro executor you can run:

npm run build

Production

After the build you can test the micro executor in production mode launching:

npm run start:restapi

You can test your services by Swagger available at: http://localhost:3000/swagger/index.html

FAQs

Package last updated on 20 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc