@metablock/core
TypeScript icon, indicating that this package has built-in type declarations

0.26.8 • Public • Published

Metablock Core

Core tooling for metablock applications

Metablock API Client

import { Metablock } from "@metablock/core";

const cli = new Metablock({ token: "" });
const user = await cli.user.getUser();

Organizations

The metablock client access the organizations endpoints via cli.orgs component. Check the org REST docs for more detailed information.

Spaces

The metablock client access the organizations endpoints via cli.spaces component. Check the space REST docs for more detailed information.

Blocks

The metablock client access the organizations endpoints via cli.blocks component. Check the block REST docs for more detailed information.

Tools

Urls

Easily create urls for your block.

  1. assetUrl for the asset uploaded in the block storage
  2. deployUrl for the current live deployment with sha key
  3. liveUrl point to same assets as deployUrl but without the sha (url does not change across deployment)

Use with a relative path

import { liveUrl } from "@metablock/core";
const url = liveUrl("icons/myicon.svg");

Logger

A simple logger utility for node and the browser

import { getLogger } from "@metablock/core";

const logger = getLogger();
logger.debug("Hi!");
logger.info("Hi!"); // Hi!

const logger2 = getLogger({ level: "debug" });
logger2.debug("Hi!"); // Hi!

const child = logger.child("test");
child.info("Hi!"); // test Hi!

compileOptions(text)

From a text of the form:

entry1: balabla
entry2: another entry
...

return a Object with corresponding key value pairs.

Readme

Keywords

Package Sidebar

Install

npm i @metablock/core

Homepage

metablock.io

Weekly Downloads

89

Version

0.26.8

License

ISC

Unpacked Size

247 kB

Total Files

54

Last publish

Collaborators

  • lsbardel
  • qmbot