pnpm
Nodemon.io
Our great sponsors
pnpm | Nodemon.io | |
---|---|---|
90 | 137 | |
27,371 | 25,942 | |
2.2% | - | |
9.8 | 7.9 | |
4 days ago | 1 day ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pnpm
-
Unit Testing in Node.js and TypeScript: A Comprehensive Guide with Jest Integration
A package manager such as npm, Yarn, or pnpm. A package manager is a tool that helps you manage the dependencies of your project. You can use any of these package managers to install Jest and other packages.
-
Effective nodejs version management for the busy developer
I also recommend using pnpm as a package manager, it's faster and more efficient than npm or yarn with great capabilities concerning monorepo setup. On recent nodejs versions (v16.13+), you can install it easily with:
-
.dockerignore being ignored by docker-compose? no space left on device
FROM node:21-alpine AS base FROM base AS builder Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat RUN apk update Set working directory WORKDIR /app Install pnpm with corepack RUN corepack enable && corepack prepare pnpm@latest --activate Enable pnpm add --global on Alpine Linux by setting home location environment variable to a location already in $PATH https://github.com/pnpm/pnpm/issues/784#issuecomment-1518582235 ENV PNPM_HOME=/usr/local/bin RUN pnpm install turbo --global COPY . . RUN turbo prune web --docker Add lockfile and package.json's of isolated subworkspace FROM base AS installer RUN apk add --no-cache libc6-compat RUN apk update WORKDIR /app First install the dependencies (as they change less often) COPY .gitignore .gitignore COPY --from=builder /app/out/json/ . COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml RUN pnpm install Build the project COPY --from=builder /app/out/full/ . RUN pnpm turbo run build --filter=web FROM base AS runner WORKDIR /app Don't run production as root RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs USER nextjs COPY --from=installer /app/apps/web/next.config.js . COPY --from=installer /app/apps/web/package.json . Automatically leverage output traces to reduce image size https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./ COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public CMD node apps/web/server.js
-
NPMprune: Remove unnecessary files from node_modules to optimize storage
I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
-
how to manage node modules in every proj?
Also maybe try https://pnpm.io/ which aparently does linking or something for you, havent used it.
-
Yarn 4.0
│ └── tsconfig.json
Whenever pnpm installs workspace dependencies, it installs them at the root of the workspace, (in the tore inside the docker build image of course, not on the host), and those are the dependencies for all 3 packages all together in one virtual store, here:
./node_modules/.pnpm
So, when I want to create my container image for say packages/app1, I don't see how I could copy only my dependencies for that app from the build image like this:
COPY --from=deps /app/packages/app2/node_modules/ /app/packages/app2/node_modules
Because while of course the dependencies are installed in the build image, they are at the root of the workspace in virtual store there, and not in /app/packages/app2/node_modules/ – this directory only contains symlinks to the root virtual store.
Of course I can copy all the dependencies from the root virtual store of the build image into my image, but then those are the dependencies for ALL packages in the workspace, not just for app1
I suppose I could try to install only the dependencies for app1, but this is broken with the default pnpm settings at the moment (it still installs dependencies for everything in the workspace)
-
Building a Minimalist Docker Image with Node, TypeScript
FROM node:18.16.0-alpine RUN apk add \ curl \ git \ && rm -rf /var/cache/* \ && mkdir /var/cache/apk RUN mkdir -p /app WORKDIR /app RUN mkdir -p /bin && curl -fsSL "https://github.com/pnpm/pnpm/releases/download/v8.6.3/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm; ENV PATH /app/node_modules/.bin:$PATH ADD package.json pnpm-lock.yaml .npmrc /app/ RUN pnpm install ADD . /app RUN pnpm run build EXPOSE 5000 CMD [ "pnpm", "start" ]
-
Lockfile merge conflicts, how to handle it correctly?
The conflict resolution algorithm for pnpm is maintained by the @pnpm/merge-lockfile-changes project.
-
Releasing local.ai - an LLM local playground with minimal setup
What version of pnpm are you using? I found this issue, maybe it's related?
-
Why is PNPM not supported in Expo app?
Please check here https://github.com/nrwl/nx-labs/issues/34 and here https://github.com/pnpm/pnpm/issues/1501
Nodemon.io
-
Full Stack Web Development Concept map
nodemon - enables automatic reload of your server after code change docs
-
Devlog Week 3: 4 - 10 December 2023
Then, install nodemon (in the VSCode terminal also), which, to my understanding, automatically refreshes the server you'll be sending requests to, whenever you make a change. Using plain node.js, you'd have to manually stop and restart the server after every change.
-
Say Goodbye to Docker Volumes 👋
That's already pretty good, but as you already know it's a PITA to work with this during development. You will have to rebuild your Docker images whenever you change your code, even though your apps will probably support hot-reloading out of the box (or with something like Nodemon if not).
-
Set up Hot Reload for Typescript ESM projects
Are you moving your projects to use ES Modules but you are facing some unexpected issues? You are not alone in this fight. In this tutorial, you will learn how to set up nodemon along with ts-node.
-
Building a React/Express Stripe Donation Form
We can now use npm run dev to start the server using nodemon, which enables hot refreshing on changes.
- Nodemon not watching for file changes
-
Setting Up Recurring Charges with the Rapyd Collect API
You’ll need to restart the server using node index.js whenever you change any project file. You can also use Nodemon to automate this.
-
Add payments feature in your application using Node.js/Express and Stripe
nodemon will be required to monitor for any changes in our source code and automatically restart our server.
-
How does nodemon works under the hood?
Using Chokidar to watch for the file changes - https://github.com/remy/nodemon/blob/main/lib/monitor/watch.js
What are some alternatives?
PM2 - Node.js Production Process Manager with a built-in Load Balancer.
supervisor
nx - Smart Monorepos · Fast CI
forever - A simple CLI tool for ensuring that a given script runs continuously (i.e. forever)
lerna - :dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
berry - 📦🐈 Active development trunk for Yarn ⚒
yarn - The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
deno - A modern runtime for JavaScript and TypeScript.
npm
chokidar - Minimal and efficient cross-platform file watching library
Bower - A package manager for the web
Phusion Passenger - A fast and robust web server and application server for Ruby, Python and Node.js