1.1.0 • Published 5 years ago

@dillonchr/domget v1.1.0

Weekly downloads
-
License
GPL-2.0
Repository
github
Last release
5 years ago

npm.io

DOMGet

What you got here is a simplified request maker that translates your request's response into dang ol' parsed html. I was using jsdom but realized it's pretty heavy on the dependency front. So in the process of breaking up my server into modules I thought I'd make my own simpler parser.

This isn't meant to replace JSDOM for other folks. Just for funhouse.

Install

npm i @dillonchr/domget

Usage

Handles http and https. It will break if you feed it a 301 url that redirects http to https. But anyway usage is simple.

const domget = require('@dillonchr/domget');
domget('https://docs.npmjs.com/getting-started/scoped-packages', (err, dom) => console.log(err || dom.querySelector('h1').text));