@paulwib/query-dom

3.4.4 • Public • Published

query-dom Build Status

query-focused & somewhat standards compliant subset of the DOM

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install query-dom --save

Usage

import {parse, parseFragment} from 'query-dom';

const document = parse('<div><foo style="font-size: 12px" class="bar"></foo></div>');
const child = document.getElementsByTagName('foo')[0];

console.log(child.style.fontSize);
console.log(child.classList.contains('bar'), child.classList.contains('bas'));
console.log(child.innerHTML);

const fragment = parseFragment('<div><foo style="font-size: 12px" class="bar"></foo><foo class="bar">bas</bar></div>');
const children = fragment.querySelectorAll('.bar');

console.log('children', children);

Tests

npm install
npm test

Dependencies

  • camelcase-css: Convert a dash-separated CSS property to a camelCased DOM property.
  • cssauron: create matching selectors from css for your very own nested object hierarchy
  • object-assign: ES2015 Object.assign() ponyfill
  • parse5: WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js
  • to-fast-properties: Force V8 to use fast properties for an object

Dev Dependencies

  • ava: Futuristic test runner 🚀
  • babel-cli: Babel command line.
  • babel-core: Babel compiler core.
  • babel-preset-es2015: Babel preset for all es2015 plugins.
  • devtool: runs Node.js programs through Chromium DevTools
  • jsdom: A JavaScript implementation of the DOM and HTML standards
  • minidom: Small DOM level 1 implementation
  • npm-run-all: A CLI tool to run multiple npm-scripts in parallel or sequential.
  • nyc: the Istanbul command line interface
  • package-json-to-readme: Generate a README.md from package.json contents
  • semistandard: All the goodness of feross/standard with semicolons sprinkled on top.
  • snazzy: Format JavaScript Standard Style as Stylish (i.e. snazzy) output
  • tsml: ES6 template string tag for multi-line cleaning - squash multi-line strings into a single line

License

MIT

Generated by package-json-to-readme

Readme

Keywords

none

Package Sidebar

Install

npm i @paulwib/query-dom

Weekly Downloads

0

Version

3.4.4

License

MIT

Last publish

Collaborators

  • paulwib