[Pkg-javascript-commits] [node-expat] 246/371: Update README.markdown

Jonas Smedegaard dr at jones.dk
Sun Feb 28 10:00:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-expat.

commit fade8a1545f101f7d314aaa32fcd08dbf298388c
Author: Lloyd Watkin <lloyd at evilprofessor.co.uk>
Date:   Wed May 7 15:37:44 2014 +0100

    Update README.markdown
---
 README.markdown | 84 +++------------------------------------------------------
 1 file changed, 3 insertions(+), 81 deletions(-)

diff --git a/README.markdown b/README.markdown
index 961f7aa..029875d 100644
--- a/README.markdown
+++ b/README.markdown
@@ -5,29 +5,16 @@
 You use [node.js](http://github.com/ry/node) for speed? You process
 XML streams? Then you want the fastest XML parser: [libexpat](http://expat.sourceforge.net/)!
 
-## Speed 
+## Manual
 
-A stupid speed test is supplied in `bench.js`. We measure how many
-25-byte elements a SAX parser can process:
+Please see the [node-expat manual](http://node-xmpp.github.io/doc/nodeexpat.html)
 
-- [node-xml](http://github.com/robrighter/node-xml) (pure JavaScript): 23,000 el/s
-- [libxmljs](http://github.com/polotek/libxmljs) (libxml2 binding): 77,000 el/s
-- [node-expat](http://github.com/astro/node-expat) (libexpat binding, this): 113,000 el/s
-
-These numbers were recorded on a Core 2 2400 MHz.
-
-## Instructions 
+## Install 
 
 Install node-expat:
 
     npm i node-expat
   
-### Installing on windows?
-
-Dependencies for `node-gyp` https://github.com/TooTallNate/node-gyp#installation
-
-See https://github.com/node-xmpp/node-expat/issues/78 if you are getting errors about not finding `nan.h`.
-
 ## Testing
 
 ```
@@ -35,68 +22,3 @@ npm test
 ```
 
 [![Build Status](https://travis-ci.org/node-xmpp/node-expat.png)](https://travis-ci.org/node-xmpp/node-expat)
-
-
-## Usage ##
-
-Important events emitted by a parser:
-
-```javascript
-(function () {
-  "use strict";
-
-  var expat = require('node-expat')
-    , parser
-    ;
-
-  /* pass encoding only if not specified in XML document */
-  parser = new expat.Parser("UTF-8");
-  parser.on('startElement', function (name, attrs) {
-    console.log(name, attrs);
-  });
-  parser.on('endElement', function (name) {
-    console.log(name);
-  });
-  parser.on('text', function (text) {
-    console.log(text);
-  });
-  parser.on('error', function (err) {
-    console.error(err); 
-  });
-  parser.write("<html><head><title>Hello World</title></head><body><p>Foobar</p></body></html>");
-}());
-
-```
-
-Use `test.js` for reference.
-
-## API ##
-
-- `#on('startElement' function (name, attrs) {})`
-- `#on('endElement' function (name) {})`
-- `#on('text' function (text) {})`
-- `#on('processingInstruction', function (target, data) {})`
-- `#on('comment', function (s) {})`
-- `#on('xmlDecl', function (version, encoding, standalone) {})`
-- `#on('startCdata', function () {})`
-- `#on('startCdata', function () {})`
-- `#on('endCdata', function () {})`
-- `#on('entityDecl', function (entityName, isParameterEntity, value, base, systemId, publicId, notationName) {})`
-- `#on('error', function (e) {})`
-- `#stop()` pauses
-- `#resume()` resumes
-
-## Error handling ##
-
-We don't emit an error event because libexpat doesn't use a callback
-either. Instead, check that `parse()` returns `true`. A descriptive
-string can be obtained via `getError()` to provide user feedback.
-
-Alternatively, use the Parser like a node Stream. `write()` will emit
-error events.
-
-## Namespace handling ##
-
-A word about special parsing of *xmlns:* this is not neccessary in a
-bare SAX parser like this, given that the DOM replacement you are
-using (if any) is not relevant to the parser.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expat.git



More information about the Pkg-javascript-commits mailing list