{"name":"strata","version":"0.4.5","author":{"name":"Michael Jackson","email":"mjijackson@gmail.com"},"description":"A fast, streaming web framework patterned after WSGI/Rack","keywords":["web","server","framework","middleware","rack","jsgi","wsgi","connect","express"],"homepage":"http://stratajs.org","engines":{"node":"~0.4.7"},"repository":{"type":"git","url":"git://github.com/mjijackson/strata.git"},"dependencies":{"gzbz2":"0.1.0"},"devDependencies":{"vows":"0.5.9"},"main":"./lib","bin":{"strata":"./bin/strata"},"_npmJsonOpts":{"file":"/Users/michael/.npm/strata/0.4.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"strata@0.4.5","_engineSupported":true,"_npmVersion":"1.0.25","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"af25c2514ca781f4ca33dafe7b35d0b8e28d3842","tarball":"http://registry-npm.ywwl.com/strata/download/strata-0.4.5.tgz","integrity":"sha512-GETu7AWN5FhF2oA7jGKAmS7lzuZZfzHjQDawNSAqgymZcerxQLbRVfP5Lgxabgl5BC+0D/kLVlxyoAxFehkplA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLsZ19py5+UElwGeaLyEkghfJ/kSFYoQGp3qSOcxSQWAiEAzWLxhxqGjQMEcx4R6F8n/G0XArTGriSqvmbK0WchOog="}],"size":84443,"noattachment":false,"key":"/strata/-/strata-0.4.5.tgz"},"scripts":{},"maintainers":[{"name":"mjijackson","email":"mjijackson@gmail.com"}],"directories":{},"_npmUser":{"name":"mjijackson","email":"mjijackson@gmail.com"},"readme":"[![build status](https://secure.travis-ci.org/mjijackson/strata.png)](http://travis-ci.org/mjijackson/strata)\n\nStrata is a streaming HTTP server for node.js that is patterned after time-honored web server design principles pioneered in the Python and Ruby communities, namely [WSGI](http://www.wsgi.org/) and [Rack](http://rack.rubyforge.org/). Using Strata, developers can build highly performant web servers in a powerful, modular style that is easy to maintain and takes full advantage of the streaming capabilities and excellent I/O handling of node.js.\n\nThe core Strata distribution consists of four things:\n\n  - A specification (see SPEC) for building applications and middleware\n  - A library (see lib) with many useful utilities and middleware to aid\n    developers in the common tasks of building applications that conform to\n    the specification\n  - An executable (see bin/strata) for running Strata applications from the\n    command line\n  - A user manual (see doc) that contains detailed documentation and code\n    examples\n\n## Installation\n\nInstall Strata using [npm](http://npmjs.org/):\n\n    $ npm install strata\n\nYou are also free to [browse or download the source](https://github.com/mjijackson/strata).\n\n## Usage\n\nThe simplest possible Strata app looks like this:\n\n``` javascript\nfunction app(env, callback) {\n  callback(200, {}, \"Hello world!\");\n}\n\nrequire(\"strata\").run(app);\n```\n\nAs you can see from the example above, a Strata \"app\" is simply a JavaScript function that accepts two arguments: the server environment and a callback. The environment contains all sorts of information about the current request including headers, POST and session data, and much more. The callback is used to send the response. You can read much more about both the environment and the callback in the [SPEC](https://raw.github.com/mjijackson/strata/master/SPEC).\n\nA slightly more complex application might look something like the following:\n\n``` javascript\nvar strata = require('strata');\n\nstrata.use(strata.commonLogger); // Log requests to the console\nstrata.use(strata.file, '/path/to/public'); // Serve static files in /path/to/public\nstrata.use(strata.contentType, 'text/html'); // Default Content-Type to text/html\nstrata.use(strata.contentLength); // Set the Content-Length automatically\nstrata.use(strata.sessionCookie, { // Enable cookie-based sessions\n  secret: 'session secret string' // Set a session secret for security\n});\n\nstrata.get('/', function (env, callback) {\n  callback(200, {}, 'Hello anonymous!');\n});\n\nstrata.get('/:username', function (env, callback) {\n  var route = env.route;\n  callback(200, {}, 'Hello ' + route.username + '!');\n});\n\n// Start the server on port 3000\nstrata.run({ port: 3000 });\n```\n\nThere are many more usage examples in the [Strata user manual](http://stratajs.org/manual).\n\n## Documentation\n\nThe [Strata user manual](http://stratajs.org/manual) is designed to teach you how to get up and running with the framework as quickly as possible. Each chapter of the manual contains documentation about a certain feature of the framework and a code example.\n\nThe manual is written in such a way that the topics and examples discussed in higher numbered chapters build upon previous ones. Thus, it is recommended to start with lower numbered chapters when getting started and work your way up to higher ones.\n\nThe user manual refers to the [SPEC](https://raw.github.com/mjijackson/strata/master/SPEC) in various places. This document is the canonical reference for the key building blocks of the framework including applications, callbacks, and the Strata environment.\n\n## Tests\n\nThe test directory contains a comprehensive suite of unit tests for Strata. Use [mocha](http://visionmedia.github.com/mocha/) to run them all:\n\n    $ mocha test/*-test.js\n\nOr run the tests for a specific module:\n\n    $ mocha test/utils-test.js\n\n## License\n\nCopyright 2012 Michael Jackson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nThe software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.\n\n## Acknowledgements\n\nStrata was inspired by similar efforts in the Python and Ruby communities, namely [WSGI](http://www.wsgi.org/) and [Rack](http://rack.rubyforge.org/). It borrows many code patterns from these libraries, as well as the [JSGI](http://jackjs.org/jsgi-spec.html) project.\n\nStrata's multipart parser is based on the fast parser in the node-formidable project written by Felix Geisendörfer. It is included in Strata under the terms of the MIT license.\n\nMy sincere thanks to the authors of each of these libraries for the excellent work they've done and graciously shared.\n","publish_time":1323272364798,"_cnpm_publish_time":1323272364798,"dist-tags":{"latest":"0.20.1"}}