Skip to content
@tselect-npm

@tselect

A collection of carefully crafted Typescript modules.

TSelect

A collection of small, focused, fully-typed TypeScript utilities for Node.js, published under the @tselect namespace on npm.

Each package is developed and released independently in its own repository.

Packages

Package Description npm
@tselect/access-control Simple, flexible RBAC / ABAC access control for Node.js and TypeScript. npm
@tselect/countries Country, currency and language enums and data (ISO 3166 / 4217 / 639). npm
@tselect/http-method HTTP method enum and type guards / case utilities. npm
@tselect/schema Typed, composable, programmatic JSON schemas. npm
@tselect/status-code HTTP status code enum and classification helpers. npm
@tselect/thrown Handle specific exceptions in TypeScript like a classic OOP try/catch. npm
@tselect/url Small URL string utilities (slashes, protocol, join). npm

At a glance

// @tselect/status-code
import { StatusCode, is5xx } from '@tselect/status-code';
StatusCode.OK;                                // 200
is5xx(StatusCode.INTERNAL_SERVER_ERROR);      // true

// @tselect/http-method
import { HTTPMethod, isHTTPMethod } from '@tselect/http-method';
HTTPMethod.GET;                               // get
isHTTPMethod('get');                          // true

// @tselect/countries
import { Countries, CountryCode } from '@tselect/countries';
Countries.get(CountryCode.AC).getMainCurrency().getDecimals(); // 2

// @tselect/schema
import { object, email } from '@tselect/schema';
object({ foo: email() });                     // { type: 'object', additionalProperties: false, ... }

// @tselect/url
import * as URL from '@tselect/url';
URL.ensureSlashes('/foo', { leading: false, trailing: true }); // foo/

// @tselect/thrown
import { thrown } from '@tselect/thrown';
try { doSomething(); }
catch (err: any) { thrown(err).catch(TypeError, e => {/* ... */}).rethrowUncaught(); }

Design principles

  • Small and single-purpose — each package solves one problem and has minimal dependencies.
  • Fully typed — first-class TypeScript, shipping .d.ts typings for editor autocompletion.
  • CommonJS output — compiled to dist/ and consumed from main + typings.
  • MIT licensed.

License

MIT © Sylvain Estevez

Pinned Loading

  1. status-code status-code Public

    HTTP status codes utility.

    TypeScript 2 1

  2. access-control access-control Public

    Simple, flexible and reliable access control for NodeJS and Typescript. Supports both RBAC and ABAC.

    TypeScript 47 6

  3. schema schema Public

    Typed, programmatic JSON schemas.

    TypeScript 5

Repositories

Showing 8 of 8 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…