marked-gfm-heading-id
Advanced tools
Comparing version 1.0.0 to 2.0.0
{ | ||
"name": "marked-gfm-heading-id", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "marked GFM heading ids", | ||
"main": "src/index.js", | ||
"main": "./lib/index.cjs", | ||
"module": "./src/index.js", | ||
"browser": "./lib/index.umd.js", | ||
"type": "module", | ||
"files": [ | ||
"lib/", | ||
"src/" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./src/index.js", | ||
"require": "./lib/index.cjs" | ||
} | ||
}, | ||
"keywords": [ | ||
@@ -14,3 +27,3 @@ "marked", | ||
"lint": "eslint .", | ||
"build": "rollup -c rollup.config.esm.js" | ||
"build": "rollup -c rollup.config.cjs" | ||
}, | ||
@@ -31,23 +44,26 @@ "repository": { | ||
"dependencies": { | ||
"github-slugger": "^1.3.0" | ||
"github-slugger": "^1.4.0" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^19.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/commit-analyzer": "^8.0.1", | ||
"@semantic-release/git": "^9.0.0", | ||
"@semantic-release/github": "^7.2.3", | ||
"@semantic-release/npm": "^7.1.3", | ||
"@semantic-release/release-notes-generator": "^9.0.2", | ||
"eslint": "^7.26.0", | ||
"eslint-config-standard": "^16.0.2", | ||
"eslint-plugin-import": "^2.23.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^5.1.0", | ||
"jest-cli": "^26.6.3", | ||
"marked": "^2.0.3", | ||
"rollup": "^2.48.0", | ||
"semantic-release": "^17.4.3" | ||
"@babel/core": "^7.19.6", | ||
"@babel/preset-env": "^7.19.4", | ||
"@rollup/plugin-commonjs": "^23.0.2", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/commit-analyzer": "^9.0.2", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/github": "^8.0.6", | ||
"@semantic-release/npm": "^9.0.1", | ||
"@semantic-release/release-notes-generator": "^10.0.3", | ||
"babel-jest": "^29.2.1", | ||
"eslint": "^8.26.0", | ||
"eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-n": "^15.3.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"jest-cli": "^29.2.1", | ||
"marked": "^4.1.1", | ||
"rollup": "^3.2.3", | ||
"semantic-release": "^19.0.5" | ||
} | ||
} |
@@ -8,8 +8,8 @@ # marked-gfm-heading-id | ||
```js | ||
const marked = require("marked"); | ||
const gfmHeadingId = require("marked-gfm-heading-id"); | ||
import { marked } from "marked"; | ||
import { gfmHeadingId } from "marked-gfm-heading-id"; | ||
// or ES Module script | ||
// import marked from "https://cdn.jsdelivr.net/gh/markedjs/marked/lib/marked.esm.js"; | ||
// import this extension from "https://cdn.jsdelivr.net/gh/UziTech/marked-gfm-heading-id/lib/index.mjs"; | ||
// import { marked } from "https://cdn.jsdelivr.net/gh/markedjs/marked/src/marked.js"; | ||
// import { gfmHeadingId } from "https://cdn.jsdelivr.net/gh/UziTech/marked-gfm-heading-id/src/index.js"; | ||
@@ -31,6 +31,9 @@ const options = { | ||
```js | ||
import { marked } from "marked"; | ||
import { gfmHeadingId, reset } from "marked-gfm-heading-id"; | ||
marked.use(gfmHeadingId()); | ||
marked("# heading\n\n# heading"); | ||
gfmHeadingId.reset(); | ||
reset(); | ||
marked("# heading\n\n# heading"); | ||
@@ -37,0 +40,0 @@ ``` |
@@ -1,9 +0,9 @@ | ||
const GithubSlugger = require('github-slugger'); | ||
import GithubSlugger from 'github-slugger'; | ||
let slugger; | ||
function reset() { | ||
export function reset() { | ||
slugger = new GithubSlugger(); | ||
} | ||
module.exports = ({ prefix = '' } = {}) => { | ||
export function gfmHeadingId({ prefix = '' } = {}) { | ||
reset(); | ||
@@ -18,4 +18,2 @@ | ||
}; | ||
}; | ||
module.exports.reset = reset; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45
Yes
5532
20
6
55
1
Updatedgithub-slugger@^1.4.0