Skip to content

Commit

Permalink
chore: ESM only
Browse files Browse the repository at this point in the history
BREAKING CHANGE: module is now ESM only
  • Loading branch information
Trott committed Aug 31, 2022
1 parent 32b220e commit 910c20f
Show file tree
Hide file tree
Showing 12 changed files with 1,186 additions and 2,364 deletions.
14 changes: 3 additions & 11 deletions .karma.config.js → .karma.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@ module.exports = function (config) {
config.set({
frameworks: ['mocha', 'chai'],
files: [
'slug.js',
'node_modules/requirejs/require.js', // Used to test loading via AMD.
'test/**/*.js',
{ pattern: 'slug.js', type: 'module' },
{ pattern: 'test/**/*.js', type: 'module' }
],
preprocessors: { 'slug.js': 'coverage' },
reporters: ['progress', 'coverage'],
coverageReporter: {
dir: '.nyc_output',
reporters: [
{ type: 'json', subdir: '.', file: 'karma.json' }
]
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Make strings URL-safe.

- Respects [RFC 3986](https://tools.ietf.org/html/rfc3986)
- No dependencies
- Works in browser (`window.slug`) and AMD/CommonJS-flavoured module loaders
- Works in the browser or in Node.js

```
npm install slug
Expand Down Expand Up @@ -36,7 +36,7 @@ Here are some key differences between this package and [`slugify`](https://githu
## Example

```javascript
var slug = require('slug')
import slug from 'slug'
var print = console.log.bind(console, '>')

print(slug('i love unicode'))
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const slug = require('../slug')
import slug from '../slug.js'

const BENCHMARK_RUNS = 2048
const MAX_WORD_LENGTH = 16
Expand Down
Loading

0 comments on commit 910c20f

Please sign in to comment.