Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit c0e6b91

Browse files
author
Adam Kliment
committed
NPM package boilerplate
1 parent 185abd5 commit c0e6b91

File tree

13 files changed

+93
-16
lines changed

13 files changed

+93
-16
lines changed

.gitignore

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
lib-cov
2-
*.seed
3-
*.log
4-
*.csv
5-
*.dat
6-
*.out
7-
*.pid
8-
*.gz
9-
10-
pids
11-
logs
12-
results
13-
1+
/lib
2+
/node_modules
143
npm-debug.log

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- 0.8
4+
- 0.10
5+
notifications:
6+
email:
7+
recipients:
8+
- adam@apiary.io
9+
on_success: change
10+
on_failure: always

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
http-string-parser
2-
==================
1+
# http-string-parser
32

4-
Parse HTTP Request and Response from String in Node.JS
3+
[![Build Status](https://travis-ci.org/apiaryio/http-string-parser.png)](https://travis-ci.org/apiaryio/http-string-parser)
4+
[![Dependency Status](https://david-dm.org/apiaryio/http-string-parser.png)](https://david-dm.org/apiaryio/http-string-parser)
5+
[![devDependency Status](https://david-dm.org/apiaryio/http-string-parser/dev-status.png)](https://david-dm.org/apiaryio/http-string-parser#info=devDependencies)
6+
7+
Parse HTTP message (Request and Response) from raw string in Node.JS
8+
9+
# Parse HTTP Message
10+
```javascript
11+
var parser = require('http-string-parser');
12+
13+
message = parser.parse(string);
14+
15+
console.log(message['request']);
16+
console.log(message['response']);
17+
```
18+
19+
- - -
20+
21+
NOTE: Proof of concept, naive HTTP parsing. In future may be replaced with better parser from Node.JS core's C bindings of NGINX Http parser

package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "http-string-parser",
3+
"version": "0.0.0",
4+
"description": "Parse HTTP Request and Response from String",
5+
"main": "lib/parser.js",
6+
"scripts": {
7+
"test": "scripts/test",
8+
"prepublish": "scripts/prepublish"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/apiaryio/http-string-parser"
13+
},
14+
"dependencies": {
15+
},
16+
"devDependencies": {
17+
"coffee-script": "1.6.3",
18+
"mocha": "1.11.0",
19+
"chai": "1.7.1",
20+
"curl-trace-parser": ""
21+
},
22+
"keywords": [
23+
"http",
24+
"message",
25+
"request",
26+
"response",
27+
"parser",
28+
"string",
29+
"raw",
30+
"bare"
31+
],
32+
"author": "Adam Kliment <adam@apiary.io>",
33+
"license": "MIT"
34+
}

scripts/bdd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
./node_modules/mocha/bin/mocha -w --reporter spec --compilers 'coffee:coffee-script' ./test/**/*-test.coffee

scripts/build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
if [ -d "src/" ]; then
3+
rm -fr lib/
4+
node_modules/.bin/coffee -b -c -o lib/ src/
5+
#mkdir lib
6+
#cp -a -R src/* lib/
7+
fi
8+
9+

scripts/prepublish

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
./scripts/test &&
3+
./scripts/build

scripts/test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
./scripts/build
3+
./node_modules/mocha/bin/mocha --reporter spec --compilers 'coffee:coffee-script' ./test/**/*-test.coffee

src/parser.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports.parse = () ->

test/fixtures/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)