🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@communities-webruntime/services

Package Overview
Dependencies
Maintainers
2
Versions
353
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@communities-webruntime/services

If you would like to run Lightning Web Runtime without the CLI, we expose some of our programmatic APIs available in Node.js. If you're looking for the CLI documentation [you can find that here](https://www.npmjs.com/package/@communities-webruntime/cli).

latest
npmnpm
Version
1.66.8
Version published
Maintainers
2
Created
Source

Lightning Web Runtime :: Core API

If you would like to run Lightning Web Runtime without the CLI, we expose some of our programmatic APIs available in Node.js. If you're looking for the CLI documentation you can find that here.

Context

Most operations require that a context be already established. The context says a lot about your application and since the compiler is stateless, you will have to establish a context before starting. The context-service provides you with 3 methods: startContext, getContext and endContext.

Usage

import { startContext } from '@webruntime/api';

await contextService.startContext(options);

try {
    // do something
} finally {
    contextService.endContext();
}

Reference

Context Service Documentation

Generators

TBD

Usage

Get all the resources for the current application:

import { routeService, resourceService } from '@webruntime/api';

const resources = routeService.getRoutesResources(routes, theme, locale, isDesignMode);
await Promise.all(
    resources.map((routeDescriptor) => {
        return resourceService.get(routeDescriptor);
    })
);

Reference

Express Middlewares

TBD

Reference

FAQs

Package last updated on 02 Dec 2021

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