From c495194a0daa85a313d585fadf74decdc4984ec2 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 17 Aug 2026 22:24:05 -0500 Subject: [PATCH] Add `npm run` Has Some Typo Aliases as a JavaScript TIL --- README.md | 3 +- javascript/npm-run-has-some-typo-aliases.md | 62 +++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 javascript/npm-run-has-some-typo-aliases.md diff --git a/README.md b/README.md index 4c08715..c9d86e7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1864 TILs and counting..._ +_1865 TILs and counting..._ See some of the other learning resources I work on: @@ -651,6 +651,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Matching Multiple Values In A Switch Statement](javascript/matching-multiple-values-in-a-switch-statement.md) - [Mock A Function With Return Values Using Jest](javascript/mock-a-function-with-return-values-using-jest.md) - [New Dates Can Take Out Of Bounds Values](javascript/new-dates-can-take-out-of-bounds-values.md) +- [`npm run` Has Some Typo Aliases](javascript/npm-run-has-some-typo-aliases.md) - [Numbers Are Empty](javascript/numbers-are-empty.md) - [Object Initialization With Shorthand Property Names](javascript/object-initialization-with-shorthand-property-names.md) - [Obtain Undefined Value With The Void Operator](javascript/obtain-undefined-value-with-the-void-operator.md) diff --git a/javascript/npm-run-has-some-typo-aliases.md b/javascript/npm-run-has-some-typo-aliases.md new file mode 100644 index 0000000..4c40827 --- /dev/null +++ b/javascript/npm-run-has-some-typo-aliases.md @@ -0,0 +1,62 @@ +# `npm run` Has Some Typo Aliases + +The developers of the `npm` CLI know that sometimes we are trying to run +commands in a hurry. It's easy to be trying to type `npm run` and instead type +`npm rum` or `npm urn`. No worries though, the command will still work. + +If I run `npm help run`, I'll see a manpage that opens with the following: + +``` +NPM-RUN(1) NPM-RUN(1) + +NAME + npm-run - Run arbitrary package scripts + + Synopsis + npm run [-- ] + + aliases: run-script, rum, urn + + ... +``` + +Notice it lists a few _aliases_ including `rum` and `urn`. + +Here are two examples of me running my test suite with `rum` and then `urn`. + +```bash +❯ npm rum test:run + +> test:run +> vitest run + + + RUN v3.0.7 /Users/lastword/dev/jbranchaud/still + + ✓ app/javascript/utils/urlUtils.test.js (6 tests) 2ms + ✓ app/javascript/utils/clipboardImage.test.js (20 tests) 3ms + + Test Files 2 passed (2) + Tests 26 passed (26) + Start at 22:07:53 + Duration 298ms (transform 17ms, setup 0ms, collect 22ms, tests 5ms, environment 270ms, prepare 63ms) + + +❯ npm urn test:run + +> test:run +> vitest run + + + RUN v3.0.7 /Users/lastword/dev/jbranchaud/still + + ✓ app/javascript/utils/urlUtils.test.js (6 tests) 3ms + ✓ app/javascript/utils/clipboardImage.test.js (20 tests) 3ms + + Test Files 2 passed (2) + Tests 26 passed (26) + Start at 22:07:58 + Duration 305ms (transform 20ms, setup 0ms, collect 25ms, tests 6ms, environment 269ms, prepare 61ms) +``` + +See `npm help run` for more details.