Socket
Socket
Sign inDemoInstall

remark-usage

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-usage - npm Package Compare versions

Comparing version 11.0.0 to 11.0.1

41

lib/index.js

@@ -238,2 +238,3 @@ /**

)
/* c8 ignore next -- weird resolve errors. */
} catch {}

@@ -297,3 +298,3 @@

? findExplicitExample(cwd, givenExample)
: findImplicitExample(cwd)
: await findImplicitExample(cwd)

@@ -336,25 +337,29 @@ if (!example) {

* Base.
* @returns {string | undefined}
* @returns {Promise<string | undefined>}
* URL.
*/
function findImplicitExample(cwd) {
async function findImplicitExample(cwd) {
const from = pathToFileURL(cwd).href + '/'
const examples = [
'./example.js',
'./example/index.js',
'./examples.js',
'./examples/index.js',
'./doc/example.js',
'./doc/example/index.js',
'./docs/example.js',
'./docs/example/index.js'
'example.js',
'example/index.js',
'examples.js',
'examples/index.js',
'doc/example.js',
'doc/example/index.js',
'docs/example.js',
'docs/example/index.js'
]
let index = -1
while (++index < examples.length) {
const example = examples[index]
try {
return resolve(example, from)
} catch {}
try {
return await Promise.any(
examples.map(function (d) {
const url = new URL(d, from)
return fs.stat(url).then(function () {
return url.href
})
})
)
} catch {
return undefined
}

@@ -361,0 +366,0 @@ }

{
"name": "remark-usage",
"version": "11.0.0",
"version": "11.0.1",
"description": "remark plugin to add a usage example to your readme",

@@ -39,3 +39,3 @@ "license": "MIT",

"@types/mdast": "^4.0.0",
"import-meta-resolve": "^3.0.0",
"import-meta-resolve": "^4.0.0",
"mdast-util-from-markdown": "^2.0.0",

@@ -42,0 +42,0 @@ "mdast-util-heading-range": "^4.0.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