Skip to content

Use ESM #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 27, 2022
Merged

Use ESM #43

merged 3 commits into from
Oct 27, 2022

Conversation

wooorm
Copy link
Collaborator

@wooorm wooorm commented Oct 26, 2022

  • This commit switches the package over to actual ESM, it must be imported with import
  • The default export is the slug class, the static function is exposed as a named export:
    import GithubSlugger, {slug} from 'github-slugger'
  • This also uses an actual ES6 class instead of prototype/constructor. This means that you now must use new to create an instance (it was optional before):
    const slugger = new GithubSlugger()

/cc @Flet

Use ESM

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* This commit switches the package over to actual ESM, it must
  be imported with `import`
* The default export is the slug class, the static function is
  exposed as a named export:
  ```js
  import GithubSlugger, {slug} from 'github-slugger'
  ```
* This also uses an actual ES6 class instead of
  prototype/constructor.
  This means that you now **must** use `new` to create
  an instance (it was optional before):
  ```js
  const slugger = new GithubSlugger()
  ```
@codecov-commenter
Copy link

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (571af53) compared to base (4bfc760).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #43   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           22        58   +36     
=========================================
+ Hits            22        58   +36     
Impacted Files Coverage Δ
index.js 100.00% <100.00%> (ø)
regex.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -1,25 +0,0 @@
const test = require('tape')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined this file above, and dropped some unneeded tests

@Flet
Copy link
Owner

Flet commented Oct 26, 2022

Checking it out now!

@wooorm wooorm merged commit b9f19db into master Oct 27, 2022
@wooorm wooorm deleted the esm branch October 27, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants