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

h2m

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h2m - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

18

bin/h2m-cli.js

@@ -9,2 +9,3 @@ #!/usr/bin/env node

var pkg = require('../package.json')
var clipboardy = require('clipboardy')

@@ -33,10 +34,13 @@ function loadHTMLFromURI(uri, callback) {

.version(pkg.version)
.arguments('<file>')
.action(function(file) {
if (/^(http|https):\/\//.test(file)) {
loadHTMLFromURI(file, onHTMLReady)
} else if (file) {
onHTMLReady(loadHTMLFromFile(file))
.option('-f, --file <file>', 'HTML file path or an url adress', '')
.option('-c, --clipboard', 'read HTML from clipboard')
.action(function(env) {
if (env.clipboard) {
onHTMLReady(clipboardy.readSync() || '')
} else if (/^(http|https):\/\//.test(env.file)) {
loadHTMLFromURI(env.file, onHTMLReady)
} else if (env.file) {
onHTMLReady(loadHTMLFromFile(env.file))
} else {
throw new Error('an http url or file path must be given')
console.log('use h2m -h to learn usage')
}

@@ -43,0 +47,0 @@ })

{
"name": "h2m",
"version": "0.6.0",
"version": "0.7.0",
"description": "Transform HTML to markdown base on posthtml.",

@@ -32,2 +32,3 @@ "main": "index.js",

"dependencies": {
"clipboardy": "~1.2.3",
"commander": "^2.9.0",

@@ -34,0 +35,0 @@ "htmlparser2": "^3.9.0",

@@ -77,8 +77,8 @@ # h2m

Usage: h2m [options] <file>
Options:
-h, --help output usage information
-V, --version output the version number
-V, --version output the version number
-f, --file <file> HTML file path or an url adress (default: )
-c, --clipboard read HTML from clipboard
-h, --help output usage information
```

@@ -89,3 +89,3 @@

```bash
$ h2m index.html
$ h2m -f index.html

@@ -102,9 +102,15 @@ converting HTML to Markdown

```bash
$ h2m https://baidu.com
$ h2m -f https://baidu.com
```
Convert from clipboard:
```bash
$ h2m -c
```
Save result:
```bash
$ h2m https://google.com > google.md
$ h2m -f https://google.com > google.md
```

@@ -111,0 +117,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