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 🙏

© 2024 – Pkg Stats / Ryan Hefner

docker-typescript-base

v0.0.6

Published

run typescript code in docker containers in prod, dev, test, and debug environments

Downloads

5

Readme

Docker Typescript Base

A base for building services using Docker and Typescript:

  • scripts for running typescript code inside 5 different containerized environments:
    • npm run docker:prod
      • starts the production system in docker container
    • npm run docker:dev
      • starts the development system in watch mode in docker container
    • npm run docker:test
      • runs the test suite in watch mode in docker container
    • npm run docker:test-debug
      • runs the test suite in debug watch mode in docker container
    • npm run docker:debug
      • starts the development system in debug watch mode in docker container
  • scripts for running typescript code locally in 6 different environments
    • npm start
      • starts the production system
    • npm run start:dev
      • starts the development system in watch mode
    • npm run test
      • runs the test suite in watch mode
    • npm run test:debug
      • runs the test suite in debug watch mode
    • npm run test:debug-scoped <some it block description>
      • runs command line specified it block description in debug watch mode
    • npm run debug
      • run the development system in debug watch mode
  • multi environment typescript configuration
    • tsconfig:dev.json
    • tsconfig:prod.json
  • prettier configuration
    • prettier.config.js
  • eslint configuration
    • eslint.config.json
  • Whenever introducing a new service, follow these steps (UNIX instructions):

      1. in your $HOME/app directory (or wherever all of your services are located on your local machine):
      • git clone https://github.com/coreycosman/docker-typescript-base.git && cd docker-typescript-base
      1. rm -rf .git
      1. git init
      1. npm i
      1. reanme your new service accordingly - cd && mv ~/<your-local-directory>/docker-typescript-base ~/<your-local-directory>/<new-service-name>
  • The entry point is src/index.ts

  • debugging in mulitple environments:

    • chrome node devtools
      • scripts attach debugger to port 4242, locally and in docker container
      • ensure your chrome node debugger has a connection to localhost:4242 established
    • VSCode
      • in the .vscode directory, there is a launch.json included with a configuration for attaching docker to node, on port 4242

      • to hit debugger statements in VSCode with specific debugger scripts, run the npm script and once the console indicates that the debugger is listening, run VSCode Docker: Attach to Node debugger configuration

      • currently, VSCode debugger breakpoints work for the following debug scripts:

        • npm run test:debug
        • npm run test:debug-scoped
      • if you know how to hit VSCode debugger breakpoints inside docker container, it would be greatly appreciated if you opened up a pull request to demonstrate :)

      • currently, debugger statements work for all of the debug scripts:

        • npm run docker:test-debug

        • npm run docker:debug

        • npm run test:debug

        • npm run test:debug-scoped

        • npm run debug

All feedback and contributions are welcomed and appreciated! Happy Coding! :)