Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-autolink-headings

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-autolink-headings - npm Package Compare versions

Comparing version 6.1.0 to 7.0.0

index.d.ts

90

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc