Socket
Socket
Sign inDemoInstall

faraday

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faraday - npm Package Compare versions

Comparing version 1.11.5 to 1.11.6

3

package.json
{
"name": "faraday",
"version": "1.11.5",
"version": "1.11.6",
"main": "faraday.coffee",

@@ -27,4 +27,3 @@ "engines": "node 0.10",

"_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",
"_id": "faraday@1.11.2"
}

@@ -76,2 +76,12 @@ Faraday

Beware Git
----------
If you load your app to a server with git, be careful: faraday requires that you have certain directories in your root: models, views, etc. Git ignores empty folders, so you need to make sure you get them to your server somehow. To do so, you can create a <code>.gitignore</code> file in each directory with the single line <code>.DS_Store</code>.
A Note On Heroku
----------------
Before deploying your app to Heroku, run <code>npm init</code>. This will set up a <code>package.json</code> file Heroku needs.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc