npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mike.mitterer/typescript-starter

v0.1.7

Published

This is a starter project for typescript projects

Downloads

6

Readme

TypeScript -

Understanding TypeScript - Udemy

Install

sudo npm install npm@latest -g
npm install -g typescript

Packages

npm install <package> [--save-dev]
     
npm install @types/mocha --save-dev
npm install lite-server --save-dev

# WebPack
npm install webpack webpack-cli webpack-dev-server --save-dev

Update

Update local packages

# Check
npm outdated

# Update
npm update    
 

Types for better Code (2)

FunctionType (2/21)

Functiontype: (P1,p2) => rettype Objekttypen: so ähnlich nur mit geschwungene Klammern

type Complex = { ... }

Union types (2/22)

let age : number | string = 10

Check types (2/23)

it(typeof myvar == "string")

never type (2/24)

Wenn ein Error geworfen wird

nullable (2/25)

Per default sind alle vars nullable Force tsconfig Union type hebt die Einschränkung auf (Pipe)

Compiler (3)

Empfohlene settings für tsconfig

  • noEmitOnError - No JS on error
  • noImplicitAny
  • sourceMap
  • noImplicitAny
  • strictNullChecks
  • noUnusedParameters

Klassen (5)

Abstract-Class

abstract class Test {
    ...
    abstract changeName(name: string) : string
}

Bei den properties ist auch readonly möglich.

readonly vs const

The easiest way to remember whether to use readonly or const is to ask whether you’re using it on a variable or a property. Variables use const whereas properties use readonly.

Namespaces + Modules (6)

namespace MyName {
    export namespace OtherName {
        export function abc() {}
        export function xyz() {}
    }            
}

MyName.OtherName.abc();

Interfaces (7)

TypeScript - Interfaces

Interfaces können auch mit Funktionen oder, als Function-Param, mit Objekten verwendet werden

Generics (8)

Funktioniert im Prinzip wie bei Java

Nicht zu vergessen:

class Name<T extends BaseValue | number> {
    ...
}    

NPM

https://medium.freecodecamp.org/how-to-make-a-beautiful-tiny-npm-package-and-publish-it-2881d4307f78

# Login
npm login
   
# Publish
npm publish --access=public
    

Test

Läuft mit JEST

Watch funkt nicht richtig - Solution:

npm r -g watchman && brew install watchman

Watch-Mode

npm test -- --watch basics    

Publish

GitHub TypeScript package to NPM

Einmalig muss ein login gemacht werden

# Login
npm login

# publish please
npm install --save-dev publish-please

Anzeige der Files die "gepublished" werden

npm pack --dry-run
                

WebStorm

In Languages & Frameworks / TypeScript den richtigen Interpreter einstellen

source/tsconfig.json ist wichtig da hier als output-dir dist spezifiziert wird

Dart + TS

https://codeburst.io/how-to-use-javascript-libraries-in-your-dart-applications-e44668b8595d

TypeScript: exposing module types in the global context EXPOSE GLOBAL VARIABLES, METHODS, AND MODULES IN JAVASCRIPT

Expose Loader

Links