🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

ts-blocks

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-blocks

A CLI to blocks to your project.

latest
Source
npmnpm
Version
0.11.0
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

ts-blocks

Well documented, tested, self owned building blocks for TypeScript applications.

npx ts-blocks init

Check out our docs.

What is ts-blocks?

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.

Setup

Run the init command to setup the blocks.json file.

npx ts-blocks init

Adding Blocks

Single

npx ts-blocks add result

Multiple

npx ts-blocks add result array-sum

Blocks

All blocks can be found under the ./blocks directory or you can view the typedoc generated documentation here.

Tests

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
}

Testing CLI Command

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.

Test single

ts-blocks test result

Test multiple

ts-blocks test result array-sum

Keywords

blocks

FAQs

Package last updated on 06 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts