Git Product home page Git Product logo

typescript-node's Introduction

Node.js 14 & TypeScript

Summary

Develop Node.js 14 based applications in TypeScript. Includes Node.js, eslint, yarn, and the TypeScript compiler.

Metadata Value
Contributors The VS Code Team
Definition type Dockerfile
Published image mcr.microsoft.com/vscode/devcontainers/typescript-node:14
Published image architecture(s) x86-64
Container host OS support Linux, macOS, Windows
Languages, platforms Node.js, TypeScript

Using this definition with an existing folder

While the definition itself works unmodified, you can also directly reference pre-built versions of .devcontainer/Dockerfile by using the image property in .devcontainer/devcontainer.json or updating the FROM statement in your own Dockerfile to:

mcr.microsoft.com/vscode/devcontainers/typescript-node:14

Alternatively, you can use the contents of the Dockerfile or the JavaScript and Node.js Dockerfile to fully customize your container's contents.

Beyond TypeScript, Node.js, and git, this image / Dockerfile includes eslint, zsh, Oh My Zsh!, a non-root vscode user with sudo access, and a set of common dependencies for development. It also installs tslint globally and includes the VS Code TSLint extension for backwards compatibility, but TSLint has been deprecated in favor of ESLint, so eslint and its corresponding extension has been included as well.

Note that, while eslintand typescript are installed globally for convenance, but as of ESLint 6, you will need to install the following packages locally to lint TypeScript code: @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint, typescript.

Adding the definition to your project

Just follow these steps:

  1. If this is your first time using a development container, please follow the getting started steps to set up your machine.

  2. To use the pre-built image:

    1. Start VS Code and open your project folder.
    2. Press F1 select and Remote-Containers: Add Development Container Configuration Files... from the command palette.
    3. Select the Node.js 14 & TypeScript definition.
  3. To use the Dockerfile for this definition (rather than the pre-built image):

    1. Clone this repository.
    2. Copy the contents of containers/typescript-node-14/.devcontainer to the root of your project folder.
    3. Start VS Code and open your project folder.
  4. After following step 2 or 3, the contents of the .devcontainer folder in your project can be adapted to meet your needs.

  5. Finally, press F1 and run Remote-Containers: Reopen Folder in Container to start using the definition.

Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

  1. If this is your first time using a development container, please follow the getting started steps to set up your machine.
  2. Clone this repository.
  3. Start VS Code, press F1, and select Remote-Containers: Open Folder in Container...
  4. Select the containers/typescript-node-14 folder.
  5. After the folder has opened in the container, press F5 to start the project. This will automatically run npm install and compile the source before starting it.
  6. Once the project is running, press F1 and select Remote-Containers: Forward Port from Container...
  7. Select port 3000 and click the "Open Browser" button in the notification that appears.
  8. You should see "Hello remote world!" after the page loads.
  9. From here, you can add breakpoints or edit the contents of the test-project folder to do further testing.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See LICENSE.

typescript-node's People

Contributors

peterblazejewicz avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.