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 🙏

© 2025 – Pkg Stats / Ryan Hefner

metatypescript

v3.3.8

Published

Typescript module - sync. Alternative to CommonJS, AMD and RequireJS

Downloads

28

Readme

metatypescript

A synchronous Typescript module system. Alternative to CommonJs, AMD and RequireJS.

It is designed to manage big projects with a lot of dependencies between files/modules.

It comes with a bunch of dependencies helpers and JS generations.

The files are separated into submodules and only submodules than require recompilations will be recompiled (determined by their dependencies). Each submodule can be compiled from 0.4s to 1s so instead to have a 20s compilation project you will have a 1s compilation project:)

##Setup

npm -g install metatypescript

###Mac OS X You can install terminal-notifier package to have notifications enabled

brew install terminal-notifier

###Others OS Pynotify is used for others OS but still unstable so maybe after an inactive period you will lost notification support

##How it works Each submodule is compiled one by one and only include .d.ts of others modules.

##Usage

metatypescript [--reset] [--nosound] [--nonotification] [--es5]
  • reset: Will recompile all modules event if they are up to date
  • nosound: Disable sound alert when compilation is done
  • nonotification: Disable notification alert when compilation is done
  • es5: Target ES5 instead of ES3 (see Typescript compiler documentation for this one)

Metatypescript script will search a metatypescript.json file inside the current directory. If no file is found, the script will create an example project and will download the lib folder from https://github.com/borisyankov/DefinitelyTyped

###Example If you launch the command metatypescript inside an empty folder it will create an example project with some basic dependencies to help you understand how it works

###Configuration file metatypescript.json config file example:

 {
 	//list of module's folders
	"folders":[
		"framework/ghost", 
		"framework/browser",
		"game/battle"
	],
	//if you wanted only one JS file from a module and all its dependencies
	"out":
	{
		"battle/main":"../js/main.js"
	},
	//if true will compile for each module a JS file
	"compile_modules":false,
	"concat_sourcemaps":false
}
  • folders: List of modules paths
  • out: Compiles a typescript submodule and all its dependencies into a JS file. Modules not used by the submodule will not be included!
  • compile_modules: If true, for each module a JS file will be generated will all its submodules inside
  • concat_sourcemaps: (not recommended) If true JS files generated by the out parameter will have sourcemaps correctly configured to link JS file files to the original typescripts files. However this feature is currently unstable and add few seconds on each compile time.

###Dependencies helpers Inside a typescript file you can use these keywords to manage dependencies

####File

	#File2.ts
	///<file="File1.ts"/>

Tell the script than File1 comes before File2. When the submodule will be compiled to an unique .ts file its content will be :

///<reference path="File1.ts"/>
///<reference path="File2.ts"/>

####Module

#File1.ts
///<module="folder/module/submodule">

This line will include the folder/module/submodule .d.ts file to this current submodule. The module path can be shorter depending of the File1.ts path

If File1 path is:

  • folder/module/submodule2
#only submodule's name is needed
///<module="submodule"/> 
  • folder/module2/anyname
#module and submodule are needed
///<module="module2/submodule"/> 
  • otherwise
#absolute path is needed
///<module="folder/module2/submodule"/> 

####Lib

In typescript you can include .d.ts files to use existing librairy and still be in a strong typed environment. To use them easily with metatypescript put them into a lib folder and include them will the lib keyword

///<lib="jquery">
#will add /lib/jquery/jquery.d.ts file as dependency 

Theses files can be found at https://github.com/borisyankov/DefinitelyTyped