Permalink
Browse files

Ready for npm! :)

  • Loading branch information...
1 parent 94e9962 commit 613937cdd8bdf52783b63da0208332fb3e19a323 Siddharth Mahendraker committed Jul 21, 2011
Showing with 19 additions and 12 deletions.
  1. +14 −7 README.md
  2. +2 −2 index.js
  3. +1 −1 lib/GridFS.js
  4. +2 −2 package.json
View
@@ -4,13 +4,20 @@ Simple GridFS capabilities built on [node-mongodb-native](https://github.com/chr
* * *
-## Usage:
+## Installation:
-To use, simply include GridFS.js or GridStream.js in your project:
+Install using npm:
<code>
<pre>
-var GridFS = require('path/to/GridFS.js');
-var GridStream = require('path/to/GridStream.js');
+npm install GridFS
+</pre>
+</code>
+
+Then include GridFS in your projects like this:
+<code>
+<pre>
+var GridFS = require('GridFS').GridFS;
+var GridStream = require('GridFS').GridStream;
</pre>
</code>
@@ -23,13 +30,13 @@ make tests
</pre>
</code>
-## Example:
+## Examples:
A simple Hello World example using GridFS.
<code>
<pre>
-var GridFS = require('../GridFS.js');
+var GridFS = require('GridFS').GridFS;
// Use the test database
var myFS = new GridFS('test');
@@ -47,7 +54,7 @@ A similar example using GridStream.
<code>
<pre>
-var GridStream = require('../GridStream.js');
+var GridStream = require('GridFS').GridStream;
// Use the test database and open or create 'Hello World!'
var writeStream = GridStream.createGridWriteStream('test','Hello World!','w');
View
@@ -2,5 +2,5 @@
// Copyright(c) 2011 Siddharth Mahendraker <siddharth_mahen@me.com>
// MIT Licensed
-module.exports = require('./lib/GridFS');
-module.exports = require('./lib/GridStream');
+exports.GridFS = require('./lib/GridFS');
+exports.GridStream = require('./lib/GridStream');
View
@@ -286,7 +286,7 @@ GridFS.prototype._delete = function(filename, callback){
});
}
else{
- calxlback(new Error('The file you wish to delete does not exist.'));
+ callback(new Error('The file you wish to delete does not exist.'));
}
});
};
View
@@ -2,7 +2,7 @@
"author": "Siddharth Mahendraker <siddharth_mahen@me.com>",
"name": "GridFS",
"description": "GridFS made easy.",
- "version": "0.0.1",
+ "version": "0.0.2",
"homepage": "https://github.com/siddMahen/GridFS",
"keywords": ["GridFS", "mongodb"],
"repository": {
@@ -14,7 +14,7 @@
"test": "make tests"
},
"engines": {
- "node": "~v0.4.9"
+ "node": "v0.4.9"
},
"dependencies": {
"mongodb": ">=0.9.6-7"

0 comments on commit 613937c

Please sign in to comment.