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

markmap-cli

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markmap-cli - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

3

bin/cli.js

@@ -14,4 +14,5 @@ #!/usr/bin/env node

.action((input, cmd) => {
return createMarkmap(input, {
return createMarkmap({
open: cmd.open,
input,
output: cmd.output,

@@ -18,0 +19,0 @@ });

@@ -1,2 +0,2 @@

/*! markmap-cli v0.1.1 | MIT License */
/*! markmap-cli v0.2.0 | MIT License */
'use strict';

@@ -14,12 +14,20 @@

let template;
async function createMarkmap(input, options = {}) {
const text = await fs.promises.readFile(input, 'utf8');
async function createMarkmap(options = {}) {
const {
input,
open: openFile = true
} = options;
let {
content,
output
} = options;
if (!output) output = `${input.replace(/\.\w*$/, '')}.html`;
if (input) {
content = await fs.promises.readFile(input, 'utf8');
}
if (!output) {
output = input ? `${input.replace(/\.\w*$/, '')}.html` : 'markmap.html';
}
if (!template) {

@@ -29,3 +37,3 @@ template = await fs.promises.readFile(`${__dirname}/../templates/markmap.html`, 'utf8');

const data = transform(parse(text));
const data = transform(parse(content || ''));
const html = template.replace('{/* data */}', JSON.stringify(data));

@@ -32,0 +40,0 @@ fs.promises.writeFile(output, html, 'utf8');

{
"name": "markmap-cli",
"version": "0.1.1",
"version": "0.2.0",
"description": "Visualize your Markdown as mindmaps with Markmap",

@@ -5,0 +5,0 @@ "author": "Gerald <i@gerald.top>",

export interface ICreateOptions {
open?: boolean;
content?: string;
input?: string;
output?: string;
}
export declare function createMarkmap(input: string, options?: ICreateOptions): Promise<void>;
export declare function createMarkmap(options?: ICreateOptions): Promise<void>;
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