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

@atifsyedali/nx-go

v2.9.1

Published

<div align="center"> <h1>nx-go</h1> <p>Nx plugin to use <a href="https://go.dev">Go</a> in a <a href="https://nx.dev">Nx</a> workspace.</p> <img src="https://github.com/nx-go.png" title="nx-go" alt="nx-go logo"> <h2>Using nx-go in your company? Co

Downloads

0

Readme

Getting started

First, make sure you have a Nx Workspace.

Create a new one using the following command:

pnpm dlx create-nx-workspace go-playground --preset=empty --cli=nx --nx-cloud true
## Or using yarn
# yarn create nx-workspace go-playground --preset=empty --cli=nx --nx-cloud true
## Or using npm
# npm exec create-nx-workspace go-playground --preset=empty --cli=nx --nx-cloud true
cd go-playground

Next, install the nx-go plugin:

pnpm add -D @nx-go/nx-go
## Or using yarn
# yarn add -D @nx-go/nx-go
## Or using npm
# npm install -D @nx-go/nx-go

Create a new application:

nx g @nx-go/nx-go:app api

Usage

You can now run the Nx workspace commands:

Building the application

This command builds the application using the go build command, and stores the output in the dist/<app-name>/ directory.

nx build api

Linting the application

Lint the application using the go fmt command.

nx lint api

Serving the application

Serves the application using the go run command.

nx serve api

Watch mode

To run the application in watch mode you can use gow, after installing it on your machine.

Open the file apps/<app-name>/project.json and in the targets.serve.options object and set the cmd parameter to gow and the cwd parameter to ., like so:

{
  targets: {
    serve: {
      executor: '@nx-go/nx-go:serve',
      options: {
        cmd: 'gow', // This is the cmd that will be used
        cwd: '.', // Set working dir to project root so it picks up changes in `libs/*`
        main: 'apps/api/main.go',
      },
    },
  },
}

Testing the application

Test the application using the go test command.

nx test api

Docker

In order to build Docker containers from the Go api inside the Nx Workspace, there are 2 base images provided:

Using the base images:

# Use nxgo/cli as the base image to do the build
FROM nxgo/cli as builder

# Create app directory
WORKDIR /workspace

# Copy package.json and the lock file
COPY package.json yarn.lock /workspace/

# Install app dependencies
RUN yarn

# Copy source files
COPY . .

# Build apps
RUN yarn build api

# This is the stage where the final production image is built
FROM golang:1.17-alpine as final

# Copy over artifacts from builder image
COPY --from=builder /workspace/dist/apps/api /workspace/api

# Set environment variables
ENV PORT=3000
ENV HOST=0.0.0.0

# Expose default port
EXPOSE 3000

# Start server
CMD [ "/workspace/api" ]

MIT License

Created by Bram Borggreve.