Skip to content

Commit

Permalink
Add missing files to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Jan 22, 2023
1 parent 05d77cf commit c9f4489
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
21 changes: 16 additions & 5 deletions README.md
Expand Up @@ -11,15 +11,28 @@ DOM lite – [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
========

A small DOM implementation
where most of DOM attributes and methods from document are implemented.
for testing, server-side rendering and working with html files.


Examples
--------

```javascript
const { document, DOMParser, XMLSerializer } = require("dom-lite");

const { XMLHttpRequest } = require("dom-lite/xmlhttprequest");

// Use XMLHttpRequest in server side
var xhr = new XMLHttpRequest()
xhr.open("GET", "https://litejs.com")
xhr.responseType = "document"
xhr.onload = function() {
var doc = xhr.responseXML
// Work with DOM in familiar way
console.log(doc.querySelector("title").textContent)
}
xhr.send()

// Build DOM manually
const el = document.createElement("h1");
el.id = 123;
el.className = "large";
Expand Down Expand Up @@ -53,10 +66,8 @@ Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide)
Run tests

```
npm install -g jshint c8
npm install
npm test
jshint *.js
```


Expand All @@ -72,7 +83,7 @@ jshint *.js

## Licence

Copyright (c) 2014-2022 Lauri Rooden <lauri@rooden.ee>
Copyright (c) 2014-2023 Lauri Rooden <lauri@rooden.ee>
[The MIT License](http://lauri.rooden.ee/mit-license.txt)


9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -13,10 +13,12 @@
],
"files": [
"index.js",
"selector.js"
"interactive.js",
"selector.js",
"xmlhttprequest.js"
],
"scripts": {
"test": "c8 -r lcov -r text-summary --check-coverage --100 lj test --brief test/index.js && lj lint"
"test": "c8 -r lcov -r text-summary --check-coverage --100 lj test --brief test/index.js && jshint *.js"
},
"repository": "github:litejs/dom-lite",
"bugs": "https://github.com/litejs/dom-lite/issues",
Expand All @@ -26,8 +28,7 @@
"jshint": "2.13.6"
},
"litejs": {
"build": "lj build --readme index.js",
"lint": "jshint *.js"
"build": "lj build --readme index.js"
},
"jshintConfig": {
"esversion": 5,
Expand Down
3 changes: 1 addition & 2 deletions test/xmlhttprequest.js
Expand Up @@ -8,9 +8,8 @@ describe("XMLHttpRequest", function() {
xhr.responseType = "document"
xhr.onload = function() {
var doc = xhr.responseXML
console.log(xhr.responseText)
console.log(doc)
assert.equal(doc.documentElement.nodeName, "HTML")
assert.equal(doc.querySelector("title").textContent, "LiteJS")
assert.end()
}
xhr.send()
Expand Down

0 comments on commit c9f4489

Please sign in to comment.