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

clean-publish

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-publish - npm Package Compare versions

Comparing version 3.4.0 to 3.4.1

16

core.js

@@ -5,2 +5,3 @@ import { promises as fs } from "fs"

import glob from 'fast-glob'
import hostedGitInfo from 'hosted-git-info'

@@ -128,10 +129,19 @@ import {

export function getReadmeUrlFromRepository (repository) {
const repoUrl = typeof repository === 'string'
? repository
: repository && repository.url
if (repoUrl) return hostedGitInfo.fromUrl(repoUrl).docs()
return null
}
export async function cleanDocs (drectoryName, repository) {
const readmePath = join(drectoryName, 'README.md')
const readme = await fs.readFile(readmePath)
if (repository) {
const name = repository.match(/[^/]+\/[^/]+$/)
const readmeUrl = getReadmeUrlFromRepository(repository)
if (readmeUrl) {
const cleaned = readme.toString().split(/\n##\s*\w/m)[0] +
'\n## Docs\n' +
`Read **[full docs](https://github.com/${name}#readme)** on GitHub.\n`
`Read **[full docs](${readmeUrl})** on GitHub.\n`
await fs.writeFile(readmePath, cleaned)

@@ -138,0 +148,0 @@ }

3

package.json
{
"name": "clean-publish",
"version": "3.4.0",
"version": "3.4.1",
"description": "Clean your package before publish",

@@ -26,4 +26,5 @@ "keywords": [

"fs-extra": "^10.0.0",
"hosted-git-info": "^4.0.2",
"lilconfig": "^2.0.3"
}
}
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