Add README with install and usage guide

Signed-off-by: default avatarSnorre Magnus Davøen <>
parent 8fea89f9
Pipeline #5115 passed with stage
in 21 seconds
# Log Schema Node
\ No newline at end of file
# Log Schema Node
This is a Node module intended to make the
consumeable by Node applications. It exposes the
[JSON Schema]( based log schema as a Javascript object,
and a corresponding Typescript definitions file.
## Installation
If you use npm:
# Add npm repo if not already added:
npm set registry
npm install --save @nsd/log-schema-node
If you use yarn:
# Add npm repo if not already added:
npm set registry
yarn add @nsd/log-schema-node
## Usage
Typescript example below. ES6 would look much the same.
import {LogSchema, schema} from "@nsd/log-schema-node";
import * as JaySchema from "jayschema";
const js = new JaySchema();
const logEvent: LogSchema = {
schemaVersion: "v3",
"@timestamp": "1985-04-12T23:20:50.52Z",
levelName: "INFO",
message: "Ørliten melding",
serviceName: "some-service",
serviceVersion: "v1.0.0"
console.log(js.validate(logEvent, schema));
Currently this package only exposes the schema and the Typescript interface. In
the future it might also provide facilities for validation, etc.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment