Comparing version 4.0.0 to 4.0.1
@@ -13,2 +13,4 @@ let $Elements = require('./lib/$elements.js') | ||
* $('div a').addClass('title').html() | ||
* $.nodes | ||
* $.root().prepend('<head></head>') | ||
* $.html() | ||
@@ -33,2 +35,9 @@ * $.beautify() | ||
htmldom.root = function () { | ||
return new $Elements({ | ||
type: 'root', | ||
children: nodes | ||
}) | ||
} | ||
htmldom.html = function () { | ||
@@ -72,2 +81,4 @@ return getHtml({ | ||
return htmldom | ||
@@ -74,0 +85,0 @@ } |
@@ -125,2 +125,4 @@ let QuerySelector = require('./query.selector') | ||
} | ||
return this | ||
} | ||
@@ -140,2 +142,4 @@ /** | ||
} | ||
return this | ||
} | ||
@@ -155,2 +159,4 @@ | ||
} | ||
return this | ||
} | ||
@@ -157,0 +163,0 @@ |
{ | ||
"name": "htmldom", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Simplified html handle in nodejs", | ||
@@ -8,3 +8,3 @@ "main": "htmldom.js", | ||
"test": "mocha --recursive", | ||
"browserify": "browserify -r ./htmldom.js:htmldom > htmldom.browser.js" | ||
"umd": "browserify htmldom.js -s createHtmlDom > htmldom.umd.js" | ||
}, | ||
@@ -32,3 +32,4 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/douzi8/htmldom" | ||
"homepage": "https://github.com/douzi8/htmldom", | ||
"devDependencies": {} | ||
} |
@@ -29,6 +29,6 @@ # htmldom — Simplified html or xml handle in nodejs | ||
## browserify | ||
## umd | ||
Open [test.html](https://github.com/douzi8/htmldom/blob/master/test.html) with browser | ||
``` | ||
npm run browserify | ||
npm run umd | ||
``` | ||
@@ -170,3 +170,3 @@ | ||
### $.nodes | ||
Get a dom | ||
Get a dom tree | ||
``` | ||
@@ -176,2 +176,15 @@ $.nodes | ||
### $.root() | ||
```js | ||
let $ = createHtmlDom('<div></div>') | ||
$.root().prepend('<head></head>') | ||
// true | ||
$.root().find('div')[0] === $('div')[0] | ||
// '<head></head><div></div>' | ||
$.html() | ||
``` | ||
### $.html() | ||
@@ -178,0 +191,0 @@ If you want get html string fast, choose this api, it's only output origin html code |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
118220
45
4307
236
0