Comparing version 1.0.0-alpha-02 to 1.0.0-alpha-03
{ | ||
"name": "pirate", | ||
"version": "1.0.0-alpha-02", | ||
"version": "1.0.0-alpha-03", | ||
"description": "A simple key-value storage interface with adapters for different databases", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,16 +5,2 @@ # Argh! What's This? | ||
## Benefits | ||
The benefits of this approach are: | ||
* **Simplify your code.** The Pareto Principle often applies to storage systems, where you only need 20% of the features 80% of the time. Pirate optimizes that 80% while still allowing you to extend adapters to handle the other 20%, specific to your requirements. | ||
* **Eliminate the impedance mismatch between HTTP and storage.** Pirate follows a similar interface to that supported by HTTP: `get`, `put`, `patch`, and `delete`. There's no equivalent to `post` and there are a few additional methods, but semantically, they're very close. | ||
* **Easily switch between storage implementations.** Pirate's adapters not only hide the complexity of the underlying storage implementation, they make it much easier to change it. You can prototype using an in-memory solution, then use a database and later partition your data across servers. | ||
* **Make use of powerful event-based interfaces.** Node-style callbacks provide a reasonable least-common-denominator, but for more sophisticated applications, they can be tedious. Pirate uses a library called [Mutual][0] to provide a simple event-based interface. Each method returns an `events` object to which event handlers can be attached. Events "bubble up" (think DOM) so that error-handling no longer needs to be done local to the call. | ||
[0]:http://github.com/dyoder/mutual | ||
## Example | ||
@@ -75,1 +61,13 @@ | ||
All API methods return an Promise object. | ||
## Benefits | ||
The benefits of this approach are: | ||
* **Simplify your code.** The Pareto Principle often applies to storage systems, where you only need 20% of the features 80% of the time. Pirate optimizes that 80% while still allowing you to extend adapters to handle the other 20%, specific to your requirements. | ||
* **Eliminate the impedance mismatch between HTTP and storage.** Pirate follows a similar interface to that supported by HTTP: `get`, `put`, `patch`, and `delete`. There's no equivalent to `post` and there are a few additional methods, but semantically, they're very close. | ||
* **Easily switch between storage implementations.** Pirate's adapters not only hide the complexity of the underlying storage implementation, they make it much easier to change it. You can prototype using an in-memory solution, then use a database and later partition your data across servers. | ||
* **Make use of promise-based interfaces.** Node-style callbacks provide a reasonable least-common-denominator, but for more sophisticated applications, they can be tedious. Pirate uses promises to provide a generator-friendly interface, so you can just make your database calls using `yield` expressions. |
33206
72