Skip to content

Commit

Permalink
rewrite in typescript, build hybrid module
Browse files Browse the repository at this point in the history
Fix: #183

BREAKING CHANGE: default export changed for CommonJS importing (now the
main function is at `default`)
  • Loading branch information
isaacs committed Jan 14, 2023
1 parent 857a631 commit fc9c9d0
Show file tree
Hide file tree
Showing 25 changed files with 1,972 additions and 1,070 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.nyc_output
/dist
/coverage
/node_modules
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

A minimal matching utility.

[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch)


This is the matching library used internally by npm.

It works by converting glob expressions into JavaScript `RegExp`
objects.

## Usage

```javascript
var minimatch = require("minimatch")
```js
// hybrid module, load with require() or import
import minimatch from 'minimatch'
// or:
const minimatch = require("minimatch").default

minimatch("bar.foo", "*.foo") // true!
minimatch("bar.foo", "*.bar") // false!
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# change log

## 6.0

- hybrid module supporting both `require()` and `import`
- exported types

## 5.1

- use windowsPathNoEscape/allowWindowsEscape opts
Expand Down
13 changes: 13 additions & 0 deletions fixup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

cat >dist/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF

cat >dist/mjs/package.json <<!EOF
{
"type": "module"
}
!EOF
4 changes: 0 additions & 4 deletions lib/path.js

This file was deleted.

Loading

0 comments on commit fc9c9d0

Please # to comment.