New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nebia

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nebia

A lightweight logger library for JavaScript

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
100%
Maintainers
0
Weekly downloads
 
Created
Source

nebia

Nebia is a lightweight logger library for JavaScript, with no dependencies and size of only 2kb.

Read this in other languages: English | 简体中文

Installation

[!IMPORTANT] Totte is a pure ESM package, if you encounter difficulties using it in your project, can read this.

NPM

npm install nebia

CDN

<script type="module">
  import nebia from 'https://esm.sh/nebia';
</script>

or

<script type="importmap">
  {
    "imports": {
      "nebia": "https://esm.sh/nebia"
    }
  }
</script>
<script type="module">
  import nebia from 'nebia';
</script>

You can also use other CDNs according to your preferences, such as jsDelivr and UNPKG etc.

Usage

import logger from 'nebia';

logger.info('hello world');
[1970-01-01T00:00:00.000Z] [INFO] - hello world

You can also use Logger or createLogger to generate new instance:

import { createLogger } from 'nebia';

const logger = createLogger();

logger.setName('name');
logger.setLevel('info');
logger.info('hello world');
logger.debug('goodbye universe');
import { Logger } from 'nebia';

const logger = new Logger({
  name: 'app',
  level: 'debug',
});
logger.info('hello world');
logger.debug('goodbye universe');
[1970-01-01T00:00:00.000Z] [INFO] app - hello world
[9999-12-31T23:59:59.999Z] [INFO] app - goodbye universe

Config

enum LogLevel {
  fatal,
  error,
  warn,
  info,
  debug,
  trace,
}

type Level = keyof typeof LogLevel;

interface LogConfig {
  // default 'info'
  level: Level;
  name: string;
}

Keywords

log

FAQs

Package last updated on 19 Mar 2025

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