Comparing version 1.7.0 to 1.8.0
{ | ||
"name": "faraday", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"main": "faraday.coffee", | ||
@@ -15,3 +15,3 @@ "engines": "node 0.10", | ||
"readmeFilename": "README.md", | ||
"_id": "faraday@1.2.1", | ||
"_id": "faraday@1.7.0", | ||
"_from": "faraday@", | ||
@@ -21,3 +21,7 @@ "dist": { | ||
}, | ||
"_resolved": "https://registry.npmjs.org/faraday/-/faraday-1.1.11.tgz" | ||
"scripts": { | ||
"postinstall": "echo 'Congrats! You installed Faraday! Now run \"coffee node_modules/faraday/new.coffee\"." | ||
}, | ||
"_resolved": "https://registry.npmjs.org/faraday/-/faraday-1.1.11.tgz", | ||
"readme": "Faraday\n=======\nA lightweight MVC framework.\n\nTo begin, run the following the in the root of your app:\n\n<pre><code>coffee node_modules/faraday/new.coffee</code></pre>\n\nNow you can access faraday throught the folders <code>models</code>, <code>views</code>, and <code>controllers</code>.\n\nThe Server\n----------\n\nTo run the server, run \n\n<pre><code>./develop</code></pre>\n\nIf you get this:\n\n<pre><code>-bash: ./develop: Permission denied</code></pre>\n\nRun this:\n\n<pre><code>chmod +x develop</code></pre>\n\nThis gives develop executable permission. To get develop to work, you may need to install the ruby gem called <a href='http://sass-lang.com/'>sass</a>.\n\nModels and Modooses\n-------------------\n\nI have abandoned the old <code>models</code> folder in favor of the <code>modooses</code> model. You can still use <code>models</code>, but they are deprecated and will be removed in subsequent versions. \n\nA modoose is a humorous malamoneau of \"model\" and \"mongoose\". (I can hear you laughing). Each modoose corresponds to a mongoose model in a coffee file in the modooses folder. To create a modoose called Foo, save the file <code>./modooses/Foo.cofffee</code>: \n\n<pre><code>fooSchema = # a mongoose schema for Foo...\n\nmodule.exports = require('mongoose').model('Foo', fooSchema)</code></pre>\n\nFaraday will create this model in the database and you can access it asynchronously as: \n\n<pre><code>require('faraday').modoose(({Foo}) -> \n foo = Foo.find({bar: 'baz'})\n # Do things with the Foo modoose.\n)</code></pre>\n\nViews\n-----\n\nIn your <code>views</code> folder, put files the form <code>filename.html.underscorecoffee</code>. These will be compiled as underscore.js (HTML) templates. You can invoke them as <code>require('faraday').views.filename(scope)</code>. The <code>scope</code> object will become the scope in the underscore.js template. That way you can pass variables and data for the template to render. \n\nControllers\n-----------\n\nIn your <code>controller</code> folder, put coffeescript files. If you create a file <code>./controllers/foo.coffee</code> with the following:\n\n<pre><code>myRequestHandler = (req, res) -> \n #handle the request\n \nmodule.exports = myRequestHandler</code></pre>\n\nThen navigate to <code>localhost:3000/foo</code>, myRequestHandler will be invoked with two arguments: the node.js request object and response object. I commonly require views in a controller and invoke some corresponding view. \n\nFaraday will map directories in the controllers folder to path components in the url. For example, if you save the aforementioned coffescript as <code>./controllers/several/nested/directories/foo.coffee</code> myRequestHandler will be invoked when you navigate to <code>localhost:3000/several/nested/directories/foo</code>. You can also create path components by nesting the routing object:\n\n<pre><code>myRequestHandler = (req, res) -> \n #handle the request\n \nmodule.exports = \n several:\n nested:\n directories:\n foo: myRequestHandler</code></pre>\n\nYou can inspect how this works by reading <code>node_modules/faraday/route.coffee</code>.\n\n\n" | ||
} |
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
46633
17
1