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

tonic-universal

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tonic-universal

Isomorphic exports of @socketsupply/tonic

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

tonic-universal

Actions Status

Isomorphic exports of @socketsupply/tonic

npm install tonic-universal

Usage

Use @socketsupply/tonic or tonic-ssr from a single import identifier depending on then environment you are running.

// Shared codepaths between node and the browser.
import Tonic from 'tonic-universal'

class MyGreeting extends Tonic {
  render () {
    return this.html`<div>Hello, World.</div>`
  }
}

Tonic.add(MyGreeting, 'my-greeting')

How

tonic-universal works by utilizing environment specific exports fields so that you can have dependency injection at the built-in module resolver layer. It supports the following export fields:

  • main (cjs node)
  • browser (cjs browser) TODO: Release a dual pacakge @socketsupply/tonic to suppor this.
  • exports.import (esm node)
  • exports.reqire (cjs node)
  • exports.browser (esm browser)

License

MIT

FAQs

Package last updated on 26 Jul 2023

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