GithubHelp home page GithubHelp logo

cogitatio's Introduction

Cogitatio

Build Status

About

Cogitatio: (Latin: thinking, meditation, reflection), is a collection of libraries to provide type-safe development in typescript. Currently the focus is on node.js/nest.js.

Why

Javascript & Typescript are awesome. I love the combination of static type definition of Typescript and ability to go dynamic when needed with Javascript. With Typescript, the code is safe whenever you define type correctly, but when receive data from IO (read from file, http request...), Typescript can not protect you from invalid type. Also Typescript developers explicitly state that they will not support those use cases. Therefore, these features need to be handle in userland.

Some other libraries also tries to tackle these issues (eg: class-validator, io-ts...) but those projects all have some issues:

  • TODO

Other than that, this repo also contains other modules that commonly used for my backend developement (Nest.js specified) also, they may be placed on other repo, but I merge them all into on repo to manage easier. :)

Goals

  • Adopting new language features when possible to improve type-safety & run time performance.
  • Be as type-safe as possible, if not, prefer to error in runtime as soon as possible, try to never hide an error.
  • Keep the dependencies minimal, especially production dependencies. Because I use docker to deployment a lot.
  • Keep the packages as independent as possible.
  • TODO

Non-Goals

  • The libraries should be generic & framework independent as possible, but it will be focused on my personal preference stack below, other stacks may be added in the future:

Packages

  • core - Collection of decorators and function to define runtime type in the very type-safety way.
  • extra - Collection of frequently used schemas to used with core package.
  • joi - Deprecated. Use joi as validation library to validate data defined in core package.
  • tc39-temporal - Forked from tc39-temporal polyfill. It is a much better time interface than default Date type.
  • rtti - Provide transformer used by ttypescript to generate RTTI.
  • jwt - Type-safe JWT verifier & signer.
  • typeorm - TODO. Collection of function to work with Typeorm.
  • nestjs-common - Collection of ultilities middlewares & functions to used with Nest.js.
  • nestjs-logger - Advanced logging intergrations with Nest.js.
  • nestjs-rc - Type-safe config loader integrations with rc.
  • nestjs-validation - Integrations with "core" package to provide validation pipe.

Future package ideas

cogitatio's People

Contributors

vietthang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.