Using Zurb Foundation through NPM Installation

I am new to using nodejs and npm, so please excuse any naivety. I want to use Foundation in my latest project and use npm to install it. This worked, and mine node_modulesnow contains the source directory.

How do I now use Foundation in my markup? I have a /publicdir that contains my views, but of course it would be bad practice to provide links to the node_modules directory? Create your own route in app.jsfor files in a directory directory? I'm not sure what is best practice?

Help evaluate.

+5
source share
4 answers

, - NodeJS. NodeJS - - , PHP, ASP Ruby.

Foundation Framework - CSS-, .

- NodeJS, , - Zurb , :

<link rel="stylesheet" href="styles/foundation.css">
0

. connect express, - :

var express = require('express'),
    stylus = require('stylus'),
    app = express();

app.use(stylus.middleware({
    compile: function (str, path) {
        return stylus(str)
            .set('filename', path)
            .use(require('foundation')());
    }
}));

styl

@import "foundation"
+8

Foundation npm

npm install foundation-sites

Foundation - <link>.

Foundation Bower

bower install foundation

Foundation ( bower_components) - <link>.


Foundation GitHub " " Foundation.

+3

You can get the base code. git: //github.com/ch1c0t/bower-foundation-css.git OR git: //github.com/mmcgahan/sass-foundation.git. Bower is a client-side package manager similar to npm, but for the client. http://bower.io/

0
source

All Articles