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

zkat / npx / 298
86%

Build:
DEFAULT BRANCH: latest
Ran 06 Nov 2017 11:39PM UTC
Jobs 4
Files 8
Run time 1min
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

pending completion
298

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%)

126.64 hits per line

Jobs
ID Job ID Ran Files Coverage
1 298.1 06 Nov 2017 11:39PM UTC 0
82.82
Travis Job 298.1
2 298.2 06 Nov 2017 11:39PM UTC 0
82.82
Travis Job 298.2
3 298.3 06 Nov 2017 11:40PM UTC 0
82.82
Travis Job 298.3
4 298.4 06 Nov 2017 11:40PM UTC 0
82.82
Travis Job 298.4
Source Files on build 298
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #298
  • f64ae43e on github
  • Prev Build on latest (#292)
  • Next Build on latest (#299)
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