Well documented, tested, self owned building blocks for TypeScript applications.
npx ts-blocks init
Check out our docs.
ts-blocks is a collection of well documented, and tested utility functions and types that can be easily dropped into your project.
They have 0 dependencies and allow you to modify the code to your own requirements. This allows you to own the code without having to write it yourself every time.
Run the init
command to setup the blocks.json
file.
npx ts-blocks init
npx ts-blocks add result
npx ts-blocks add result array-sum
All blocks can be found under the ./blocks
directory or you can view the typedoc generated documentation here.
Each block is tested using vitest. By default we add these tests to your project when you add a block. To disable this behavior configure includeTests
in your blocks.json
file.
[!NOTE] If vitest isn't already installed in your project we will attempt to install it for you.
{
"$schema": "https://unpkg.com/ts-blocks@0.1.0/schema.json",
// ...
"includeTests": false // disable including tests
}
npx ts-blocks test
If you don't want to include the tests in your project source or simply want to keep your code up to date with the latest test cases you can run tests through the CLI.
ts-blocks test result
ts-blocks test result array-sum