-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Improve Usage & Related Resources sections
- describe cli - describe `extract` script - move API into Usage section
- Loading branch information
Showing
1 changed file
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,12 @@ xmltest | |
|
||
## Usage | ||
|
||
### Install | ||
|
||
- `npm install -D github:karfau/xmltest` | ||
|
||
### In tests | ||
|
||
- In you tests: | ||
|
||
```javascript | ||
|
@@ -69,9 +73,24 @@ describe('unit', () => { | |
}); | ||
``` | ||
|
||
### command line interface | ||
|
||
- `node xmltest` or `npx xmltest` will print all entries as JSON, similar to calling `getEntries` | ||
- passing one or multiple arguments will use them with `createFilters` | ||
and return the filtered content in the same way as `getContent` does: | ||
- with **only** one argument and a single matching entry it only returns the content itself | ||
- otherwise, it returns a json where the keys are the path inside the zip file, and the values are the content | ||
|
||
|
||
### Extract & Inspect zip content | ||
|
||
In case the command line interface is not sufficient, | ||
`npm run extract` will extract `xmltest.zip` into the `.gitignore`d `data` directory. | ||
|
||
|
||
'''If you think it's a violation of the license offered by James Clark, please [let me know](mailto:[email protected]).''' | ||
|
||
## API | ||
### API | ||
|
||
All methods have doc comments that include types. | ||
|
||
|
@@ -82,11 +101,14 @@ All methods have doc comments that include types. | |
- `getContent` | ||
- `getEntries` | ||
- `load` | ||
- `replaceWithWrappedCodePointAt` | ||
- `replaceNonTextChars` | ||
- `run` | ||
|
||
(Feel free to contribute by automating the extraction to this or other file.) | ||
(Feel free to contribute by automating the extraction of the documentation to this or another file.) | ||
|
||
## Related Resources | ||
|
||
- <http://www.jclark.com/xml/> | ||
- <http://cafeconleche.org/SAXTest/> | ||
- The page of the author linking to xmltest.zip: <http://www.jclark.com/xml/> | ||
- THe way I found those testcases since they are part of a bigger testsuite for (Java SAX parsers) <http://cafeconleche.org/SAXTest/> | ||
- The PR that initially led to the creation of this package: <https://github.com/xmldom/xmldom/pull/112> |