Skip to content

Instantly share code, notes, and snippets.

@oivvio
Last active April 5, 2016 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oivvio/b297d94a5402fc3858ccdd854a626254 to your computer and use it in GitHub Desktop.
Save oivvio/b297d94a5402fc3858ccdd854a626254 to your computer and use it in GitHub Desktop.
Minimal example with node and typings
typings
app.js

Here's a minimal TypeScript project using typings to manage 3rd party modules.

When editing the app.ts file in Visual Studio Code I get all that nice code completion. And tsc app.ts will compile without complaints.

/// <reference path="typings/main.d.ts" />
import * as os from "os";
console.log(`Your tempdir is at: ${os.tmpdir()}`);
{
"version": false,
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#513510a89acc648422c9abb047265116198f99ee"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment