• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zkat / npx / 298 / 1
86%
latest: 86%

Build:
DEFAULT BRANCH: latest
Ran 06 Nov 2017 11:39PM UTC
Files 8
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Nov 2017 11:38PM UTC coverage: 82.819% (+0.3%) from 82.558%
298.1

push

travis-ci

zkat
fix(prefix): Handle node_modules without package.json (#128)

This fixes running `npx` inside temporary projects (ones that have a
`node_modules` but don't have a `package.json`).

`getPrefix()` has useful cases:

1. Finds a path with a `package.json`, returns it.
2. Finds a path with a `node_modules`, returns it.
3. Finds nothing, returns the original path.

Cases 1 and 2 return a path that's useful to `npx`, but case 3 doesn't.
But, `localBinPath()` confused case 2 and 3 (by stating for a
`package.json`), making `npx` only work with case 1. That's no good.

This makes cases 1 and 2 distinct from case 3 (it just returns `false`
now). And `localBinPath()` no longer has to do any stating to
differentiate between paths and `false`, so it's happy. And now `npx`
can run without a local `package.json`. Yay!

Fixes: https://github.com/zkat/npx/issues/104
Fixes: https://github.com/babel/babel/issues/4066#issuecomment-336705199

244 of 305 branches covered (80.0%)

Branch coverage included in aggregate %.

320 of 376 relevant lines covered (85.11%)

31.2 hits per line

Source Files on job 298.1
  • Tree
  • List 0
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 298
  • Travis Job 298.1
  • f64ae43e on github
  • Prev Job for on latest (#292.2)
  • Next Job for on latest (#299.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc