Permalink
Browse files

Updated addressable dependency version. Added some TODOs.

  • Loading branch information...
1 parent bd239a4 commit 3f332981753196a4984dc76b4d03b19c9436ef00 @slaskis slaskis committed May 22, 2011
Showing with 20 additions and 8 deletions.
  1. +12 −3 README.md
  2. +1 −1 lib/open-uri.js
  3. +2 −1 lib/schemes/ftp.js
  4. +5 −3 package.json
View
@@ -68,6 +68,10 @@ Uses the [addressable module](https://github.com/publicclass/addressable) for pa
## History
+### 0.3.1
+
+* [Fix] Updated `addressable` dependency to 0.3.3. Now both addressable.URI and Nodes built-in URL objects are valid as the `uri` argument.
+
### 0.3.0
* [Feature] Updated `addressable` dependency to 0.3.1.
@@ -113,17 +117,22 @@ Uses the [addressable module](https://github.com/publicclass/addressable) for pa
* _HTTP(S)_ Proxy support.
+* _FTP_ Listing files (when uri.pathname ends with "/")
+
+* _FTP_ Uploading files (when opts.body is passed)
+
* A timeout option for all schemes would be useful.
* A binary, just for fun really. Usage: `open-uri http://google.com`.
- Output to process.stdout by default.
- Allow a REST interface? So if something is written to stdin it's sent as body to the url using POST by default, but definable with -X (curl style!)
- Pass command line arguments as options to the scheme functions. Ex. `open-uri -gzip http://google.com` sets opts.gzip to true.
-* More schemes support? Suggestions?
- - SQL query. Is there a standard URI for this? Something like: `mysql://root@localhost/mydb?query=SELECT * FROM x;` or `sqlite3://file.sqlite?query=SELECT * FROM x;` possibly with support for input escaping. open("sqlite3://file.sqlite?query=SELECT * FROM x WHERE id=? AND name=?;",[12,"bob"]) using the drivers own escaping. With a callback like `function(err,rows,meta){}`.
+* More schemes support? Suggestions?
+ - S3 (using [knox module](https://github.com/LearnBoost/knox)), should list objects when path ends with "/"
- NNTP (using [node-nntp module](https://github.com/mscdex/node-nntp))
-
+ - IRC (using [node-irc module](https://github.com/martynsmith/node-irc)), open("irc://bot@chat.freenode.net/nodejs") -> callback for each message? with a say function in the callback? ex: `function(err,from,to,msg,say){ if( to == "bot" && ~msg.indexOf("hello") ){ say(from+": HI!") } }` `this` could be the irc object so the socket can be closed...
+ - SQL query. Is there a standard URI for this? Something like: `mysql://root@localhost/mydb?query=SELECT * FROM x;` or `sqlite3://file.sqlite?query=SELECT * FROM x;` possibly with support for input escaping. open("sqlite3://file.sqlite?query=SELECT * FROM x WHERE id=? AND name=?;",[12,"bob"]) using the drivers own escaping. With a callback like `function(err,rows,meta){}`.
## Thanks to
View
@@ -1,7 +1,7 @@
/**
* Asynchronous Open URI, inspired by Rubys Open-URI library.
*
-* @param {String} uri The URI to open.
+* @param {URI|String} uri The URI to open.
* @param {Object} opts (optional) Options for the scheme (see each scheme for details).
* @param {Function|WriteableStream} output Where to send the data.
* @return Itself for chainability.
View
@@ -28,7 +28,8 @@ module.exports = function(uri,opts,output){
request(err)
})
}
-
+
+ // TODO Add this to addressable? or maybe it's in the path-module?
var isDir = uri.path.charAt(uri.path.length-1) == "/";
if( isDir ){
// TODO If path is a directory, we client.list(uri.pathname)
View
@@ -5,10 +5,12 @@
"version": "0.3.0",
"author": "Robert Sköld <robert@publicclass.se>",
"dependencies": {
- "addressable": ">= 0.3.1",
- "mime": ">= 1.0.0",
- "ftp": "0.1.1"
+ "addressable": ">= 0.3.3",
+ "mime": ">= 1.0.0"
},
+ "devDependencies": {
+ "ftp": "0.1.1"
+ }
"keywords": ["open", "uri", "open-uri"],
"scripts": { "test": "expresso test/test-open-uri.js" },
"engines": { "node": ">= 0.3.6" }

0 comments on commit 3f33298

Please sign in to comment.