troch / path-parser

A small utility to parse paths.
MIT License
140 stars 24 forks source link

TypeError: PathParser is not a constructor #30

Closed ibc closed 4 years ago

ibc commented 6 years ago

I just upgraded from version 3.x.x to 4.2.0, and got the above error. And makes sense since, in 4.x.x, require('path-parser') returns an Object:

const PathParser = require('path-parser');

> PathParser
{ Path: { [Function: Path] createPath: [Function] },
  default: { [Function: Path] createPath: [Function] } }

So, if used in Node, const PathParser = require('path-parser').default is required. But the CHANGELOG says nothing about it.

troch commented 4 years ago

default export will be removed in next major (#42)