An easy way to create a TypeScript library without hassle.

Overview

ts-lib-template

An easy way to create a TypeScript library without hassle.

ts-lib-template is a template for creating a TypeScript library. It comes built in with many common utilities, such as git hooks, documentation generators, version bumps, and more.

Getting Started

First, install the template. There are two ways to do this.

  1. Create a copy of the template on Github and clone the new repo to your machine
  2. In the terminal run npx degit snek152/ts-lib-template new-project

Then, install the dependencies.

cd new-project
npm install

The project comes preinstalled with Husky (git hooks), Typedoc (documentation), and the Barreler CLI (make barrel exports automatically).

The commands below are available to you.

# Build the library
npm run build

# Development - watch for changes and rebuild library + remake barrels
npm run dev

# Build the docs for the library - default in docs folder
npm run make:docs

Make sure to edit your package.json file to include your library name, description, and other information.

The project also comes with a deploy action that will build the library and docs and publish them to npm and Github Pages, respectively. The action is triggered on a push or pull request to the master branch. The action also bumps the package.json version depending on your commit message, so make sure to use the following syntax for commits:

# Increment minor version
feat: your_commit_msg

# Increment patch version
fix: your_commit_msg

# Increment major version
MAJOR: your_commit_msg

# Increment release candidate version
alpha: your_commit_msg

WARNING - The deploy action will need to authenticate with npm in order to publish your package. Make sure to set the npm_token secret in the repository settings to your own token, generated from npmjs.com.

WARNING - The Github action triggers are commented out at the time of creation. Make sure to uncomment them. Additionally, the action by default triggers on a push to the master branch. Make sure to change this to your default branch if it is not master.

Motivation

In August of 2022, I decided to start developing npm packages using Typescript, starting with basic CLIs and later moving to more complex libraries. The common problem I found with all of these was that there was hardly any information out there on how to start building these kinds of packages from the ground up, and thus ts-lib-template was born.

You might also like...

Small library to create classes without using class syntax.

Clazz.js Small library to create classes without using class syntax. Compatibility For internet explorer 11 or higher. Example script src="Clazz.js"

Dec 25, 2021

Easy and flexible jQuery tabbed functionality without all the styling.

JQuery EasyTabs Plugin Tabs with(out) style. EasyTabs creates tabs with all the functionality, no unwanted changes to your markup, and no hidden styli

Nov 23, 2022

CPUSim is an open-source web-based animated x64 CPU simulator for educational purposes. Provided as a folder for easy distribution and without installation on the Google Chrome Browser. Powered by Unicorn.js, Capstone.js, Quasar and NASM.

CPUSim is an open-source web-based animated x64 CPU simulator for educational purposes. Provided as a folder for easy distribution and without installation on the Google Chrome Browser. Powered by Unicorn.js, Capstone.js, Quasar and NASM.

CPUSim - A Graphical CPU Simulator CPUSim is an open-source web-based animated x64 CPU simulator for educational purposes. Provided as a folder for ea

Oct 26, 2022

🛠 Nodejs configuration the easy way.

@elite-libs/auto-config Intro A Unified Config & Arguments Library for Node.js! Featuring support for environment variables, command line arguments, a

May 17, 2022

An easy way to animate SVG elements.

Walkway I loved the animations for the polygon ps4 review a few months back and decided to create a small library to re-create them (simple demo). It

Jan 2, 2023

An easy and simple way to manage your financial transactions.

An easy and simple way to manage your financial transactions.

MyWallet An easy and simple way to manage your financial transactions. With MyWallet you can track your incomes and expenses and always keep track of

Nov 16, 2022

DropSpace is an easy way to self-host a file drop.

DropSpace is an easy way to self-host a file drop.

DropSpace Simple file sharing made in Laravel About DropSpace DropSpace is an easy way to self-host a file drop. Simply upload your file, and share th

Dec 9, 2022

An easy way to mass download osu! beatmaps

An easy way to mass download osu! beatmaps

Batch Beatmap Downloader (Beta) Download Latest Release Table of Contents About Screenshots Getting Started Prerequisites Usage Build instructions Con

Jan 3, 2023

An easy way to discover and manage your cloud like a local filesystem

An easy way to discover and manage your cloud like a local filesystem

cfs An easy way to discover and manage your cloud like a local filesystem. The swiss army knife for finding any resource in your AWS account. ⏬ instal

Jun 4, 2022
Owner
Snehil K
15 year old professional full stack web developer, actor, and drummer at Lynbrook High School
Snehil K
The aim is to provide a hassle-free way to use the data to build applications to show close-to-realtime power-outage info in Mauritius

Mauritius Dataset for Electricity Dataset View Dataset The aim is to provide a hassle-free way to use the data to build applications. Example applicat

Sandeep Ramgolam 5 Dec 15, 2022
This will create a REST API using Express JS and MongoDB removing the hassle of creating everything from scratch.

rest-api-init Fastest way to create REST API with Node.js, Express.js & MongoDB. Prerequisites Node.js needs to be installed. MongoDB Compass needs to

Souvik Das 7 Dec 3, 2022
A simple, no-hassle library for efficiently querying Your Enrollment Services.

@vanderbilt/yes-api A simple, no-hassle library for efficiently querying Your Enrollment Services. Created by Dylan Hanson (jovialis) NOTE: THIS MODUL

Dylan Hanson 2 Jan 25, 2022
Catalogist is the easy way to catalog and make your software and (micro)services visible to your organization in a lightweight and developer-friendly way.

catalogist ?? ?? ?? ?? ?? The easy way to catalog and make your software and (micro)services visible to your organization through an API You were a pe

Mikael Vesavuori 11 Dec 13, 2022
Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party library!

PI Calculator Web JS (Online) Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party

Max Base 6 Jul 27, 2022
NFT Info: An easy way to create customizable pages about NFTs

NFT Info: An easy way to create customizable pages about NFTs Submission for the BuildQuest hackathon 2022. My goal is for NFT project creators and th

Mathijs Vogelzang 2 Mar 23, 2022
An easy and simply way to create your own image classifier AI using ml5.js and Google's Teachable Machine

An easy and simply way to create your own image classifier AI using ml5.js and Google's Teachable Machine

Mateus Vinícius de Lima 2 Apr 5, 2022
A simple Node.js code to get unlimited instagram public pictures by every user without api, without credentials.

Instagram Without APIs Instagram Scraping in August 2022, no credentials required This is a Node.js library, are you looking for the same in PHP? go t

Francesco Orsi 28 Dec 29, 2022
Fastest way to get financial data from Plaid into your Postgres database. Go from zero to live in 5 minutes without a single line of code.

Venice Venice is a the fastest way to get financial data from Plaid into your Postgres database. Zero to production in 5 minutes without a single line

Venice 93 Dec 12, 2022
🎨 Beautify your github profile with this amazing tool, creating the readme your way in a simple and fast way 🚀 The best profile readme generator you will find ⚡

Demo Profile Readme Generator The best profile readme generator you will find! About | Technologies | Requirements | Starting | Contributing ?? About

Mauro de Souza 476 Jan 1, 2023