Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lagon/runtime

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lagon/runtime

JavaScript Serverless Runtime for Lagon

  • 0.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-97.83%
Maintainers
1
Weekly downloads
 
Created
Source

Lagon

JavaScript Serverless Runtime

API

const deployment: Deployment = {
  functionId: 'custom-id',
  deploymentId: 'custom-id',
  domains: ['localhost:3000'],
  memory: 128,
  timeout: 50,
  env: {
    hello: 'world',
  },
  isCurrent: true,
}

function getDeploymentCode(deployment) {
  return `export async function handler(request) {
    return new Response("Hello world!")
  }`
}

const runIsolate = await getIsolate({
  deployment,
  getDeploymentCode,
})

const request: HandlerRequest  = {
  input: '/test',
  options: {
    method: 'GET',
    headers: {},
    body: 'request body',
  },
}

const { response } = await runIsolate(request)

Runtime

Request

new Request(input [, options])
Constructor
  • input: string
  • options?: RequestInit
RequestInit
  • method?: string
  • headers?: Record<string, string | string[] | undefined>
  • body?: string
Properties
  • method: string
  • headers: Record<string, string | string[] | undefined>
  • body: string
  • url: string
Methods
  • text(): Promise<string>
  • json<T>(): Promise<T>
  • formData(): Promise<Record<string, string>>

Response

new Response(body [, options])
Constructor
  • body: string
  • options?: ResponseInit
ResponseInit
  • status?: string
  • statusText?: string
  • headers?: Record<string, string | string[] | undefined>
  • url?: string
Properties
  • body: string
  • headers: Record<string, string | string[] | undefined>
  • ok: boolean
  • status: number
  • statusText: string
  • url: string
Methods
  • text(): Promise<string>
  • json<T>(): Promise<T>
  • formData(): Promise<Record<string, string>>

Fetch

fetch(resource [, init]): Promise<Response>

Parameters

  • resource: string
  • init?: RequestInit

Environment variables

MY_VARIABLE

Console

console.log(...args: any[])
console.error(...args: any[])
console.info(...args: any[])
console.warn(...args: any[])
console.debug(...args: any[])

FAQs

Package last updated on 22 Aug 2022

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