diff --git a/README.md b/README.md index 2c9df3b8..fdc9bce8 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,6 @@ concurrently([ So *null* means the process didn't terminate normally. This will make **concurrent** to return non-zero exit code too. -* Does this work with the npm-replacement [yarn](https://github.com/yarnpkg/yarn)? +* Does this work with the npm-replacements [yarn](https://github.com/yarnpkg/yarn) or [pnpm](https://pnpm.js.org/)? - Yes! In all examples above, you may replace "`npm`" with "`yarn`". + Yes! In all examples above, you may replace "`npm`" with "`yarn`" or "`pnpm`". diff --git a/src/command-parser/expand-npm-shortcut.js b/src/command-parser/expand-npm-shortcut.js index c5135fd1..d36f1fd9 100644 --- a/src/command-parser/expand-npm-shortcut.js +++ b/src/command-parser/expand-npm-shortcut.js @@ -1,6 +1,6 @@ module.exports = class ExpandNpmShortcut { parse(commandInfo) { - const [, npmCmd, cmdName, args] = commandInfo.command.match(/^(npm|yarn):(\S+)(.*)/) || []; + const [, npmCmd, cmdName, args] = commandInfo.command.match(/^(npm|yarn|pnpm):(\S+)(.*)/) || []; if (!cmdName) { return commandInfo; } diff --git a/src/command-parser/expand-npm-shortcut.spec.js b/src/command-parser/expand-npm-shortcut.spec.js index 1489368f..a72ed116 100644 --- a/src/command-parser/expand-npm-shortcut.spec.js +++ b/src/command-parser/expand-npm-shortcut.spec.js @@ -9,7 +9,7 @@ it('returns same command if no npm: prefix is present', () => { expect(parser.parse(commandInfo)).toBe(commandInfo); }); -for (const npmCmd of ['npm', 'yarn']) { +for (const npmCmd of ['npm', 'yarn', 'pnpm']) { describe(`with ${npmCmd}: prefix`, () => { it(`expands to "${npmCmd} run