remark-autolink-headings
Advanced tools
Comparing version 6.1.0 to 7.0.0
{ | ||
"name": "remark-autolink-headings", | ||
"version": "6.1.0", | ||
"version": "7.0.0", | ||
"description": "remark plugin to automatically add links to headings", | ||
@@ -28,68 +28,41 @@ "license": "MIT", | ||
], | ||
"main": "dist/index.js", | ||
"module": "src/index.js", | ||
"types": "types/index.d.ts", | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"dist", | ||
"types/index.d.ts", | ||
"src/index.js" | ||
"index.d.ts", | ||
"index.js" | ||
], | ||
"dependencies": { | ||
"@types/hast": "^2.0.0", | ||
"@types/mdast": "^3.0.0", | ||
"extend": "^3.0.0", | ||
"unified": "^9.0.0", | ||
"unist-util-visit": "^2.0.0" | ||
"unified": "^10.0.0", | ||
"unist-util-visit": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"ava": "3.0.0", | ||
"babel-plugin-add-module-exports": "^1.0.0", | ||
"browserify": "^17.0.0", | ||
"dtslint": "^4.0.0", | ||
"@types/extend": "^3.0.1", | ||
"@types/tape": "^4.0.0", | ||
"c8": "^7.0.0", | ||
"hastscript": "^7.0.0", | ||
"nyc": "^15.0.0", | ||
"prettier": "^2.0.0", | ||
"remark": "^13.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-html": "^13.0.0", | ||
"remark": "^14.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-html": "^14.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"remark-slug": "^6.0.0", | ||
"tinyify": "^3.0.0", | ||
"xo": "^0.34.0" | ||
"remark-slug": "^7.0.0", | ||
"rimraf": "^3.0.0", | ||
"tape": "^5.0.0", | ||
"type-coverage": "^2.0.0", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.43.0" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "npm run compile", | ||
"build": "rimraf \"test/**/*.d.ts\" \"*.d.ts\" && tsc && type-coverage", | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
"compile": "babel src --out-dir dist --ignore src/**/__tests__", | ||
"build-bundle": "browserify . -s remarkAutolinkHeadings -o remark-autolink-headings.js", | ||
"build-mangle": "browserify . -s remarkAutolinkHeadings -p tinyify -o remark-autolink-headings.min.js", | ||
"bundle": "npm run build-bundle && npm run build-mangle", | ||
"test-api": "ava", | ||
"test-coverage": "nyc --reporter lcov ava", | ||
"test-types": "dtslint types", | ||
"test": "npm run compile && npm run format && npm run bundle && npm run test-coverage && npm run test-types" | ||
"test-api": "node --conditions development test/index.js", | ||
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api", | ||
"test": "npm run build && npm run format && npm run test-coverage" | ||
}, | ||
"browserslist": "> 2.5%, node 6", | ||
"babel": { | ||
"presets": [ | ||
"@babel/preset-env" | ||
], | ||
"plugins": [ | ||
"add-module-exports" | ||
] | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"lines": 100, | ||
"functions": 100, | ||
"branches": 100 | ||
}, | ||
"ava": { | ||
"require": [ | ||
"@babel/register" | ||
] | ||
}, | ||
"prettier": { | ||
@@ -104,6 +77,3 @@ "tabWidth": 2, | ||
"xo": { | ||
"prettier": true, | ||
"ignore": [ | ||
"types/" | ||
] | ||
"prettier": true | ||
}, | ||
@@ -114,3 +84,9 @@ "remarkConfig": { | ||
] | ||
}, | ||
"typeCoverage": { | ||
"atLeast": 100, | ||
"detail": true, | ||
"strict": true, | ||
"ignoreCatch": true | ||
} | ||
} |
@@ -32,2 +32,5 @@ # remark-autolink-headings | ||
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c): | ||
Node 12+ is needed to use it and it must be `import`ed instead of `require`d. | ||
[npm][]: | ||
@@ -51,18 +54,18 @@ | ||
And our script, `example.js`, looks as follows: | ||
And our module, `example.js`, looks as follows: | ||
```js | ||
const fs = require('fs') | ||
const unified = require('unified') | ||
const markdown = require('remark-parse') | ||
const html = require('remark-html') | ||
const slug = require('remark-slug') | ||
const headings = require('remark-autolink-headings') | ||
import fs from 'node:fs' | ||
import {unified} from 'unified' | ||
import remarkParse from 'remark-parse' | ||
import remarkSlug from 'remark-slug' | ||
import remarkAutolinkHeadings from 'remark-autolink-headings' | ||
import remarkHtml from 'remark-html' | ||
const doc = unified() | ||
.use(markdown) | ||
.use(slug) | ||
.use(remarkParse) | ||
.use(remarkSlug) | ||
// Note that this module must be included after `remark-slug`. | ||
.use(headings) | ||
.use(html) | ||
.use(remarkAutolinkHeadings) | ||
.use(remarkHtml) | ||
.processSync(fs.readFileSync('example.md')) | ||
@@ -86,4 +89,7 @@ .toString() | ||
### `remark().use(autolinkHeadings[, options])` | ||
This package exports no identifiers. | ||
The default export is `remarkAutolinkHeadings`. | ||
### `unified().use(remarkAutolinkHeadings[, options])` | ||
Automatically add links to headings. | ||
@@ -90,0 +96,0 @@ |
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
20899
15
331
247
Yes
5
5
1
+ Added@types/mdast@^3.0.0
+ Added@types/mdast@3.0.15(transitive)
+ Addedbail@2.0.2(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedtrough@2.2.0(transitive)
+ Addedunified@10.1.2(transitive)
+ Addedunist-util-is@5.2.1(transitive)
+ Addedunist-util-stringify-position@3.0.3(transitive)
+ Addedunist-util-visit@4.1.2(transitive)
+ Addedunist-util-visit-parents@5.1.3(transitive)
+ Addedvfile@5.3.7(transitive)
+ Addedvfile-message@3.1.4(transitive)
- Removedbail@1.0.5(transitive)
- Removedis-plain-obj@2.1.0(transitive)
- Removedtrough@1.0.5(transitive)
- Removedunified@9.2.2(transitive)
- Removedunist-util-is@4.1.0(transitive)
- Removedunist-util-stringify-position@2.0.3(transitive)
- Removedunist-util-visit@2.0.3(transitive)
- Removedunist-util-visit-parents@3.1.1(transitive)
- Removedvfile@4.2.1(transitive)
- Removedvfile-message@2.0.4(transitive)
Updatedunified@^10.0.0
Updatedunist-util-visit@^4.0.0