@aneuhold/be-ts-lib
v2.0.0
Published
A backend TypeScript library used for common functionality in personal backend projects.
Downloads
331
Readme
Personal Backend TypeScript Library
This is a library meant to contain any common code between backend TypeScript projects.
📦 Installation
To add to a repo, follow the instructions below for your environment:
For Node using NPM
Run yarn add @aneuhold/be-ts-lib
For Node using JSR
The below instructions still allow for things like Renovate to work, and normal commands with yarn such as yarn up
.
- Add the required JSR configuration to a
.yarnrc.yml
file if not there already:npmScopes: jsr: npmRegistryServer: 'https://npm.jsr.io'
- Add the package with
yarn add @jsr/aneuhold__be-ts-lib
For Deno
Run deno add jsr:@aneuhold/be-ts-lib
🟢 Usage
Pull in one of the services and use it like so:
import { ConfigService } from '@aneuhold/be-ts-lib';
// If using Node with JSR
// import { ConfigService } from '@jsr/aneuhold__be-ts-lib';
export default async function getConfig() {
await ConfigService.useConfig('local');
const config = ConfigService.config;
console.log(config);
}