{"_id":"proton","_rev":"25-31d6b7057d13bf2c2c99ce7a7056e9df","name":"proton","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"proton","version":"0.1.0","engines":["node >=0.2.5"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tomyandell.wordpress.com/"},"bin":{"proton":"./bin/proton","proton-develop":"./bin/proton-develop"},"main":"./lib/proton","directories":{"lib":"./lib"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1"},"_id":"proton@0.1.0","_engineSupported":true,"_npmVersion":"0.2.13","_nodeVersion":"v0.2.5","dist":{"shasum":"ce869a941a2657eef48510146da5cc605fd572fd","tarball":"https://registry.npmjs.org/proton/-/proton-0.1.0.tgz","integrity":"sha512-Ok358MjCUaGXflxgzslxoleRGv5Xk2xL9Ox2FRp8lDdevaPbU3GtyaFeKyZ1d+So4mRNcWPoraZEPvgKz3WSuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3UxA0Y1ClO665mIum6dvUNACqeZizzzGXkF7pEBY8wgIhANBXzIFP/uxjrcBNPCk0XzfRZj3TJ+h5UieCzurG9jjE"}]}},"0.1.2":{"name":"proton","version":"0.1.2","engines":["node >=0.2.5"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tomyandell.wordpress.com/"},"bin":{"proton":"./bin/proton","proton-develop":"./bin/proton-develop"},"main":"./lib/proton","directories":{"lib":"./lib","bin":"./bin"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1"},"_id":"proton@0.1.2","_engineSupported":true,"_npmVersion":"0.2.16","_nodeVersion":"v0.2.5","modules":{"cli.js":"lib/cli.js","develop-cli.js":"lib/develop-cli.js","develop.js":"lib/develop.js","options.js":"lib/options.js","proton.js":"lib/proton.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"cbc8c40f5801b6869abd7ccaa71f1d3cd11ddd79","tarball":"https://registry.npmjs.org/proton/-/proton-0.1.2.tgz","integrity":"sha512-r4xwi2Ao2SK/wxZg6lHCHfUABIEpDvnY2l3eflKZc4FsZ0WEF4+8hIBp3G2Z0ZWc8ePxnSfBA08QtWBYtdIuHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw55OcFT0zPsnF/+TQnfS6m5P/my6aoUtjNHqoUsclNAIhALk0q11Cs4PjUL86UlsC5LOSalHKOboQDHFXmKE7NP5f"}]}},"0.1.3":{"name":"proton","description":"Proton is a micro framework targetted at micro frameworks. It provides a common way for micro-frameworks to interoporate with the environment that runs them.","version":"0.1.3","engines":["node >=0.2.5"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tomyandell.wordpress.com/"},"bin":{"proton":"./bin/proton","proton-develop":"./bin/proton-develop"},"main":"./lib/proton","directories":{"lib":"./lib","bin":"./bin"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1","daemon":">=0.1.0"},"repository":{"type":"git","url":"http://github.com/tomyan/proton.js.git"},"homepage":"http://github.com/tomyan/proton.js","_id":"proton@0.1.3","_engineSupported":true,"_npmVersion":"0.2.16","_nodeVersion":"v0.2.5","modules":{"cli.js":"lib/cli.js","develop-cli.js":"lib/develop-cli.js","develop.js":"lib/develop.js","options.js":"lib/options.js","proton.js":"lib/proton.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"906c6365435fac327561e4cfe8b43dcfbb16f6e6","tarball":"https://registry.npmjs.org/proton/-/proton-0.1.3.tgz","integrity":"sha512-Wj4sGswtEu82AIX/1Y6D2d5vYFe6o59Fj9Z21i9FZdh9KAZ2AIw5/fLtUYfuEYfYolj8wvNUbOOh+APewprXjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEP/mz19tITCA1xb79e5Is+JIe6xOfBr8w/f1WqH+rOnAiAdY9AUAGcvTl7S1mCMi661qXX+70WAydJERlPNWSB6rw=="}]}},"0.2.0":{"name":"proton","description":"Proton is a micro framework targetted at micro frameworks. It provides a common way for micro-frameworks to interoporate with the environment that runs them.","version":"0.2.0","engines":["node >=0.2.5"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tomyandell.wordpress.com/"},"bin":{"proton":"./bin/proton","proton-develop":"./bin/proton-develop"},"main":"./lib/proton","directories":{"lib":"./lib","bin":"./bin"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1","daemon":">=0.1.0"},"repository":{"type":"git","url":"git://github.com/tomyan/proton.js.git"},"homepage":"http://github.com/tomyan/proton.js","_id":"proton@0.2.0","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.1","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"1ea3b385eff30927e48da3f609c33deaa4d38a4c","tarball":"https://registry.npmjs.org/proton/-/proton-0.2.0.tgz","integrity":"sha512-BMNbZMMRy/vWoZ3m0h/aIG/ZLr6Qf/iJkO5vQyoPbYxkvLmoU5TdYHYzX6gWMUkTVIpKBislWn2KEPb/+RfxPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeh8uVuxFSX8EXWB7ZvUTVpMijuWY+nnigtVKcPUZD6AIhAIAVNTZnhVQDcOCWb/UHJ1SVDSLjWJjEo7UadW2I1evI"}]}},"0.3.0":{"name":"proton","description":"Proton is a micro framework targetted at micro frameworks. It provides a common way for micro-frameworks to interoporate with the environment that runs them.","version":"0.3.0","engines":["node >=0.2.5"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tom.yandell.me.uk/blog/"},"bin":{"proton":"./bin/proton"},"main":"./lib/proton","directories":{"lib":"./lib"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1","daemon":">=0.1.0"},"repository":{"type":"git","url":"git://github.com/tomyan/proton.js.git"},"homepage":"http://github.com/tomyan/proton.js","devDependencies":{},"_id":"proton@0.3.0","_engineSupported":true,"_npmVersion":"1.0.4","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"b889d98f85b865e78d5654ccbbe96da5f5700b15","tarball":"https://registry.npmjs.org/proton/-/proton-0.3.0.tgz","integrity":"sha512-TqfLXARTwGIGFDrYK87gyfmqJKQDwJ7+SOxv+rPMLo0JH4huT3XiFukD+fnKFWPSEIPFo2wYamJXh4a0ak+2lA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2MhUwOIkoD1L3nJfxBvJxBsr5uGZe15zWAXI2IMTXmAiA03G5+oTEd6/y37tnsmzvuQYbvi15c7fU8o54pyAvW0w=="}]},"scripts":{}},"0.4.0":{"name":"proton","description":"Proton is a micro framework targetted at micro frameworks. It provides a common way for micro-frameworks to interoporate with the environment that runs them.","version":"0.4.0","engines":["node >=0.2.5"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tom.yandell.me.uk/blog/"},"bin":{"proton":"./bin/proton"},"main":"./lib/proton","directories":{"lib":"./lib"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1","daemon":">=0.1.0"},"repository":{"type":"git","url":"git://github.com/tomyan/proton.js.git"},"homepage":"http://github.com/tomyan/proton.js","devDependencies":{},"_id":"proton@0.4.0","_engineSupported":true,"_npmVersion":"1.0.4","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"9308d251a6ea35c2cf920119c72c3aa0d7f96f18","tarball":"https://registry.npmjs.org/proton/-/proton-0.4.0.tgz","integrity":"sha512-M02nmiw541GRgRff1jIryYBXGdpKhXO9ZZJHXx5gg/CLhzH0RgaPvAQzFSD2D1i/zd8Hg3nDvUuz2Akto/ao/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxOAZkbcsaSOiRWxk5zWgYeqiwRleUwlYY5/DuD2MAAwIgO9/HaptMextd0TKsAnsN4IqGZJuDpNenzyMA4yi6GmA="}]},"scripts":{}},"0.4.1":{"name":"proton","description":"Proton is a micro framework targetted at micro frameworks. It provides a common way for micro-frameworks to interoporate with the environment that runs them.","version":"0.4.1","engines":["node >=0.4.0"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tom.yandell.me.uk/blog/"},"contributors":[{"name":"Richard Hodgson","email":"contact@rhodgson.co.uk"}],"bin":{"proton":"./bin/proton"},"main":"./lib/proton","directories":{"lib":"./lib"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.2.1","daemon":">=0.1.0"},"repository":{"type":"git","url":"git://github.com/tomyan/proton.js.git"},"homepage":"http://github.com/tomyan/proton.js","_npmJsonOpts":{"file":"/Users/thomasyandell/.npm/proton/0.4.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"proton@0.4.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"af5434782fd00866335a323cf37546222d895bac","tarball":"https://registry.npmjs.org/proton/-/proton-0.4.1.tgz","integrity":"sha512-Oj+OJVE04CBMIHGTS41Xq93hTMYf3JA9E22xy3XSfZHDZIVm3SRDFbAEXEnNaJVtWYI4u9QUxAXU44TgmMEXGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFEjNKqdD1oeboA40+0WJIEicgZqyltSTUMOhdgdrVygIhAJVNG5YyFuaNm2aPKXB5ypfpZGLW95+n6qm8Gwx1kNhT"}]},"scripts":{},"maintainers":[{"name":"tomyan","email":"tom@yandell.me.uk"}]},"0.5.0":{"name":"proton","description":"Proton is a tool for developing and running web applications.","version":"0.5.0","engines":["node >=0.4.0"],"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tom.yandell.me.uk/blog/"},"contributors":[{"name":"Richard Hodgson","email":"contact@rhodgson.co.uk"}],"bin":{"proton":"./bin/proton"},"main":"./lib/proton","directories":{"lib":"./lib"},"dependencies":{"jsgi":">=0.2.2","promised-io":">=0.3.0","daemon":">=0.1.0"},"devDependencies":{"usenode-release":">=1.0.0"},"repository":{"type":"git","url":"http://github.com/usenode/proton.js.git"},"homepage":"http://github.com/usenode/proton.js","readme":"See <a href=\"http://use.no.de/proton\">use.no.de/proton</a>.\n\nIntroduction\n============\n\nProton is a micro framework targetted at micro frameworks. It provides a common way for micro-frameworks to interoporate with the environment that runs them.\n\nExamples\n========\n\nWriting a Web Appliction\n------------------------\n\nYou could use it to create a web appliction (say in lib/webapp.js), which is simply a class (insomuch that anything is a class in JavaScript) that is instantiated by Proton and has its handle method invoked for each HTTP request:\n\n    var proton = require('proton');\n    \n    var WebApp = exports.WebApp = function () {\n         // initialise the webapp here\n    };\n    \n    WebApp.prototype.handle = function (request) {\n        return {\n            status  : 200,\n            headers : { 'Content-Type' : 'text/plain' },\n            body    : [ \"Hello, World\\n\" ]\n        };\n    };\n    \nEach web application built on Proton (or hopefully a framework using Proton) needs to be a module that exports <code>WebApp</code> (i.e. assigns the prototype function to <code>exports.WebApp</code>). The return value from the <code>handle</code> method should be that expected for a <a href=\"http://wiki.commonjs.org/wiki/JSGI/Level0/A/Draft2\">JSGI</a> application.\n\nTo run the project:\n\n    proton --webapp lib/webapp.js\n\nYou can now view your new web application at http://localhost:8000/. Run <code>proton --help</code> to see a list of options.\n\nWriting a Web Framework\n-----------------------\n\nProton on its own isn't very useful for building webapps - it is just a very minimal layer on top of JSGI and node.http. The real power comes when you build (or use) a micro framework on top of Proton (say in lib/framework.js):\n\n    var proton = require('proton');\n    \n    exports.webapp = function (content) {\n        var WebApp = function () {};\n        \n        WebApp.prototype.handle = function (request) {\n            return {\n                status  : 200,\n                headers : { 'Content-Type' : 'text/plain' },\n                body    : [ this.content[ request.pathInfo ] ]\n            };\n        };\n        \n        return WebApp;\n    };\n\nHere, the exported \"webapp\" function is a factory that returns prototypes for web applications (i.e. the classes that Proton expects). Somebody using this framework can now use this to create a web application class like so:\n\n    var myAmazingFramework = require(\"./framework\");\n    \n    exports.WebApp = myAmazingFramework.webapp({\n        '/' : 'Hello, World'\n    });\n\nTo run it:\n\n    proton lib/framework-webapp.js --webapp lib/mywebapp.js\n\nWriting a useful micro framework (unlike this one) is left as an exercise for the reader.\n\nAPI\n===\n\n### proton.beforeStart(WebApp, promise)\n\nThe before start takes a web application class and a promise object (Promised.IO recommended) representing an asynchronous operation that should complete before the server for that web application is started. This will be applied for all instances of that web application.\n\nInstallation\n============\n\nNPM is recommended for development, although for production you might want to find/build a package for your operating system:\n\n    npm install proton\n\nFuture Work\n===========\n\nFuture development of Proton is likely to provide features to environments that want to run Proton based frameworks and the web applictions based on them, maintaining a stable interface for web application frameworks.\n\nThis work is likely to include the following:\n\n* Automatically reload code during development.\n* An easy way to create services that run web applictions built on Proton frameworks (for deployment).\n* Ability to add JSGI middleware.\n* Ability to instantiate web applications for unit and integration testing.\n* etc.\n\nThe nice thing about this approach (and that of JSGI) is that these bits can all be separated from the web appliction frameworks and web applications themselves.\n\nSee Also\n========\n\n* Proton based (micro) frameworks\n* JSGI\n* Promised.IO\n* Node.JS\n* NPM\n","readmeFilename":"README.md","_id":"proton@0.5.0","dist":{"shasum":"8f6169f6535c1d4bbca38570822b5d07ceb1fb75","tarball":"https://registry.npmjs.org/proton/-/proton-0.5.0.tgz","integrity":"sha512-kqNbkcZTigOWpeH9QHBYMaOhAdxh1r/8w3zWNmUkU3eSILN6qxtjtRa55kGlmPEvqHygKuNq9+qoZ69FqT28eA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFdwWOQ+0LhLBC+VQdXEVZNBrKdVGimXjFQCXKPJypoAIgOvxxlJbtNvCP3kAoiUQSD0G97+WJqgU1i8IAGKUF0xc="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richardhodgson","email":"contact@rhodgson.co.uk"},"maintainers":[{"name":"tomyan","email":"tom@yandell.me.uk"},{"name":"richardhodgson","email":"contact@rhodgson.co.uk"}]}},"maintainers":[{"email":"elliot.hesp@gmail.com","name":"ehesp"}],"time":{"modified":"2022-06-24T21:04:43.577Z","created":"2011-01-29T14:11:26.874Z","0.1.0":"2011-01-29T14:11:27.241Z","0.1.2":"2011-01-29T14:40:10.309Z","0.1.3":"2011-01-31T23:17:41.258Z","0.2.0":"2011-04-30T07:53:07.250Z","0.3.0":"2011-07-02T13:44:47.439Z","0.4.0":"2011-07-03T15:07:24.253Z","0.4.1":"2011-09-04T13:19:31.148Z","0.5.0":"2012-11-11T19:45:41.428Z"},"author":{"name":"Tom Yandell","email":"tom.deletethis@yandell.me.uk","url":"http://tom.yandell.me.uk/blog/"},"description":"Proton is a tool for developing and running web applications.","repository":{"type":"git","url":"http://github.com/usenode/proton.js.git"}}