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

dogen

v0.0.4

Published

Generate your Dockerfile based on your package.json

Downloads

6

Readme

Dogen

Generate your Dockerfile based on your package.json

Very early stage of developpement, expect breaking changes

Usage as cli

npm install -g dogen
cd ./app
dogen
cat Dockerfile

Dogenrc

Generated Dockerfile can be configured using a .dogenrc at root of your project

{
  "nodeImage": "node:18-alpine3.17", // custom image to use for installing/building/running your service
  "build": {
    "script": "build:prod" // custom script (defined in your package.json) to call for building your service
  },
  "run": {
    "script": "start:prod" // custom script (defined in your package.json) to call for starting your service
  }
}

Fields

type DogenConfig = {
  /**
   * customize image used for installing/bulding/running your service
   */
  nodeImage?: string;

  /**
   * Workdir to use in dockerfile
   */
  container: {
    /**
     * customize workir used in docker to install/build/run your service
     */
    workdir?: string;
  };

  install?: {
    /**
     * customize dockerfile install target name
     */
    name?: string;
    /**
     * keep package manager cache on node_modules installation
     */
    keepCache?: boolean;
    /**
     * mount a npmrc file when running installation command, npmrc file should be provided during build using secret (e.g `docker build --secret id=npmrc,src=.npmrc [...]`)
     */
    npmrc?: boolean | string;
    /**
     * custom command to run installation
     */
    cmd?: string;
  };
  /**
   * Build related target
   */
  build?: {
    /**
     * customize dockerfile build target name
     */
    name?: string;
    /**
     * name of script present in you package.json to use to build your service. Ignored if `build.cmd` is provided
     */
    script?: string;
    /**
     * override build command with custom command
     */
    cmd?: string;

    /**
     * files to copy for building service. (by default dogen try to autodetect files that should be copied)
     */
    includes?: string | string[];
    /**
     * excludes files from `build.includes` and `build.extraIncludes`
     */
    excludes?: string | string[];
    /**
     * additional files to copy for building service.
     */
    extraIncludes?: string | string[];
  };
  postBuild: {
    /**
     * files to copy after your service is built
     */
    includes?: string | string[];
  };

  run?: {
    /**
     * customize dockerfile run target name
     */
    name?: string;
    /**
     * command to use to run your service
     */
    cmd?: string;
    /**
     * name of script present in you package.json to use to run your service. Ignored if `run.cmd` is provided
     */
    script?: string;
    /**
     * customize image used for installing/bulding/running your service
     */
    expose?: number;
  };
};