Permalink
Browse files

change *.cc *.h to src/; bumped httpsync v0.0.1

  • Loading branch information...
fengmk2 committed Jul 23, 2012
1 parent f65007e commit f00fc0485ed21173eccaa7c34e6436ce0794f62b
Showing with 51 additions and 24 deletions.
  1. +2 −0 .gitignore
  2. +25 −19 README.md
  3. +1 −0 index.js
  4. +21 −3 package.json
  5. 0 { → src}/curl.cc
  6. 0 { → src}/curl.h
  7. 0 { → src}/main.cc
  8. 0 { → src}/request.cc
  9. +1 −1 test/test.js
  10. +1 −1 wscript
View
@@ -0,0 +1,2 @@
+build/
+.lock-wscript
View
@@ -4,6 +4,12 @@
`http` module of node.js. But in contrast to `http` module's asynchronous
functions, node-curl provides the equivalent synchronous APIs.
+## Install
+
+```bash
+$ npm install httpsync
+```
+
## Build
node-waf configure && node-waf build
@@ -25,14 +31,14 @@
Example
```javascript
-var req = curl.request ({
- url: "http://cnodejs.org",
- method: "GET",
- useragent: "Ultimate Web Browser",
- headers: {
- "Tag": "TGB3123",
- "String": "A long string"
- }
+var req = curl.request({
+ url: "http://cnodejs.org",
+ method: "GET",
+ useragent: "Ultimate Web Browser",
+ headers: {
+ Tag: "TGB3123",
+ String: "A long string"
+ }
});
```
@@ -43,13 +49,13 @@ var req = curl.request ({
And you can have
```javascript
-var req = curl.get ({ url : "http://cnodejs.org"});
+var req = curl.get({ url : "http://cnodejs.org"});
```
Or just straight forward
```javascript
-var req = curl.get ("http://cnodejs.org");
+var req = curl.get("http://cnodejs.org");
```
### request.write (chunk)
@@ -63,13 +69,13 @@ var req = curl.get ("http://cnodejs.org");
Example
```javascript
-var req = curl.request ({
- url: "http://cnodejs.org",
- method: "POST"
+var req = curl.request({
+ url: "http://cnodejs.org",
+ method: "POST"
});
-req.write ("Some text\n");
-req.write ("another text");
-console.log (req.end ());
+req.write("Some text\n");
+req.write("another text");
+console.log(req.end());
```
### request.endFile (filePath)
@@ -79,10 +85,10 @@ console.log (req.end ());
Example
```javascript
-var req = curl.request ({
- url: "http://cnodejs.org",
+var req = curl.request({
+ url: "http://cnodejs.org",
});
-req.endFile ("/etc/passwd");
+req.endFile("/etc/passwd");
```
### response
View
@@ -0,0 +1 @@
+module.exports = require('./build/Release/node_curl');
View
@@ -1,5 +1,23 @@
{
- "name": "node-curl"
- , "version": "0.0.1"
- , "private": false
+ "name": "httpsync",
+ "version": "0.0.1",
+ "scripts": {
+ "install": "node-waf clean ; node-waf configure build"
+ },
+ "description": "node-curl is a port of libcurl to node.js. Its interface emulates the `http` module of node.js. But in contrast to `http` module's asynchronous functions, node-curl provides the equivalent synchronous APIs.",
+ "main": "index.js",
+ "directories": {
+ "test": "test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/zcbenz/node-curl.git"
+ },
+ "keywords": [
+ "curl",
+ "sync",
+ "http"
+ ],
+ "author": "zcbenz",
+ "license": "MIT"
}
View
File renamed without changes.
View
File renamed without changes.
View
File renamed without changes.
File renamed without changes.
View
@@ -1,5 +1,5 @@
var testy = require('./lib.js');
-var curl = require ("../node_curl");
+var curl = require ("../");
//-------------------------------------------------------------------------
View
@@ -10,5 +10,5 @@ def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
obj.target = "node_curl"
- obj.source = "main.cc curl.cc request.cc"
+ obj.source = "src/main.cc src/curl.cc src/request.cc"
obj.lib = ["curl"]

0 comments on commit f00fc04

Please sign in to comment.