JSPM

  • Created
  • Published
  • Downloads 570
  • Score
    100M100P100Q95677F
  • License MIT

A core library for all of my TypeScript projects

Package Exports

  • @aneuhold/core-ts-lib
  • @aneuhold/core-ts-lib/browser
  • @aneuhold/core-ts-lib/node

Readme

core-ts-lib

JSR NPM License

A library containing TypeScript that I am sharing among most TypeScript-based projects. This package is published using ES Modules only.

📦 Installation

To add to a repo, follow the instructions below for your environment:

For Node using NPM

Run pnpm add @aneuhold/core-ts-lib

For Node using JSR

The below instructions still allow for things like Renovate to work, and normal commands with pnpm such as pnpm up.

  1. Add the required JSR configuration to a .npmrc file if not there already:
    @jsr:registry=https://npm.jsr.io
  2. Add the package with pnpm add @jsr/aneuhold__core-ts-lib

For Deno

Run deno add jsr:@aneuhold/core-ts-lib

🟢 Usage

Pull in one of the services and use it like so:

import { DependencyRegistry, ILogger } from '@aneuhold/core-ts-lib';
// If using Node with JSR
// import { DependencyRegistry, ILogger } from '@jsr/aneuhold__core-ts-lib';

// Get the logger instance from the registry
const logger: ILogger = DependencyRegistry.logger;

export default function logSomething() {
  logger.info('Something');
}

See full documentation on usage at JSR!