New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ikerin/build-readme

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ikerin/build-readme - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

dist/cli.js

@@ -6,7 +6,6 @@ "use strict";

const process_1 = require("process");
const path_1 = require("path");
const readmePath = path_1.isAbsolute(process.argv[2]) ? process.argv[2] : path_1.join(process_1.cwd(), process.argv[2]);
const readmePath = process.argv[2];
const url = process.argv[3];
const text = fs_1.readFileSync(readmePath, 'utf8');
const { content, replacements } = _1.buildReadme(readmePath, text, url);
const { content, replacements } = _1.buildReadme(readmePath, text, process_1.cwd(), url);
fs_1.writeFileSync(readmePath, content, 'utf8');

@@ -13,0 +12,0 @@ if (replacements.length) {

2

dist/index.d.ts

@@ -8,3 +8,3 @@ /**

*/
export declare const buildReadme: (readmePath: string, text: string, url?: string | undefined) => {
export declare const buildReadme: (readmePath: string, text: string, dir: string, url?: string | undefined) => {
content: string;

@@ -11,0 +11,0 @@ replacements: {

@@ -35,9 +35,11 @@ "use strict";

*/
const buildReadme = (readmePath, text, url) => {
const buildReadme = (readmePath, text, dir, url) => {
const replacements = [];
const content = text.replace(matchExample, (match, name, _, section, filename, language) => {
replacements.push({ name, filename });
const resolvedFilename = removeAnchorHash(url && filename.includes(url) ? filename.replace(url, path_1.dirname(readmePath)) : path_1.join(path_1.dirname(readmePath), filename));
const resolvedFilename = removeAnchorHash(url && filename.includes(url)
? filename.replace(url, path_1.dirname(path_1.join(dir, readmePath)))
: path_1.join(path_1.dirname(path_1.join(dir, readmePath)), filename));
if (!fs_1.existsSync(resolvedFilename)) {
throw new Error(`File ${resolvedFilename} does not exist in ${path_1.dirname(readmePath)}`);
throw new Error(`File ${resolvedFilename} does not exist in ${dir}`);
}

@@ -44,0 +46,0 @@ const content = fs_1.readFileSync(resolvedFilename, 'utf-8');

{
"name": "@ikerin/build-readme",
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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