New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@timberio/js

Package Overview
Dependencies
Maintainers
5
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@timberio/js

Timber.io Node.js + browser logging

  • 0.35.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-76.92%
Maintainers
5
Weekly downloads
 
Created
Source

🌲 Timber - Node.js + browser logging

Beta: Ready for testing Speed: Blazing ISC License

New to Timber? Here's a low-down on logging in Javascript.

@timberio/js

This NPM library contains the following two packages:

@timberio/browser

@timberio/node

It's provided for convenience, as an alternative to installing multiple packages for universal / isomorphic apps.

Usage

Here's how to get started:

Any Node.js environment (including Webpack/Rollup)

First, install the package via NPM:

npm i @timberio/js

In ES6/Typescript, you can then import either the Browser or Node class as required for your environment:

import { Browser, Node } from "@timberio/js";

// `Browser` is equivalent to the `Timber` class exported by @timberio/browser
const clientLogger = new Browser(
  "timber-organization-key",
  "timber-source-key"
);

// And the same with `Node` and @timberio/node
const serverLogger = new Node("timber-organization-key", "timber-source-key");

For CommonJS, require the package instead:

const { Browser, Node } = require("@timberio/js");

Logging

Both the Node.js and browser logging classes provide a .log() function for logging to Timber.io

See the readme for the Node.js and browser logging for the full API.

FAQ

Why install this instead of each package separately?

@timberio/js combines the latest @timberio/browser and @timberio/node packages.

This is useful for apps that contain both Node.js (server) and browser (client) logging. It makes your package.json a bit cleaner to maintain just one package, instead of two.

Why are there different classes for the browser and Node?

The browser and Node.js APIs both have a .log() method and both extend the core JS logger.

But, each have their own optimizations for how they sync logs with Timber.io, and extra methods to take advantage of unique Node.js and browser features not available in the other environment.

LICENSE

ISC

Keywords

FAQs

Package last updated on 19 Aug 2019

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