Does anyone know of a boilerplate combining Express, Jade, Socket.io, and MySQL? All of the ones I'm able to find use a noSQL DB. I might have to just write my own templates to use, but would hate to re-invent the wheel.
I haven't tried: https://github.com/robrighter/node-boilerplate but it has most of what your after.
I can suggest using express as the boilerplate:
npm install -g express
So after you'll globally install it, you could do something like:
express newApp
which will create a new dir named newApp and populate it with the boilerplate of the framework.
(you can follow http://expressjs.com/guide.html)
afterwards, you can "cd newApp" and run
npm install
this will read the dependencies from package.json and will download the node.js modules required.
for socket.io , just run
npm install socket.io
as for jade, it's the default templating engine of express, it's built in.
Regarding mySQL , there are tones of options: https://github.com/joyent/node/wiki/Modules#wiki-db-mysql
you just have to choose. If your after ORM, i can recommend: https://github.com/sdepold/sequelize
Hope this helps.
Related
Specifically, why do I have to load/save thousands of node_modules files for each project that uses Node? It seems really redundant and inefficient to me, especially when the VAST majority of modules are the same from project-to-project. I get that this system was designed in case a developer needs to make different projects use different modules configurations. What I don't understand is; why was Node JS not designed to target a global node_modules folder and use the package.json dependencies list to specify which ones to use/not use? I assume that this would essentially work akin to how mongoose targets a MongoDB directory and only accesses the tables the specific project needs.
I'm somewhat new to MEAN so I doubt the developers didn't think of this, I'd just like to know the idea behind this decision.
If you don't want to separately install modules for each project and you're OK with all your projects using the exact same version number of each dependent module, then you can install modules once in a shared location and use them from there.
You can either install modules globally (where NPM determines what the global shared location is) with something like:
npm -g install express
And, then use it like:
const express = require('express');
Or, you can install them into your own shared location:
cd /node
npm install express
Then, in all your projects, you would use:
const express = require('/node/express');
brew install pnpm
this is the only tool that was designed at helping with this problem
I want to know what is exact use of npm, grunt etc. in front-end development?
Why and how to use it?
NPM is a Node Package Manager - you can think of it as a way to automate a lot of installations for you by a single command using the CL (command line). Otherwise you would have to install all the scripts manually, which is generally rather messy, since they are often not as user-friendly as say... game or standard program installations.
Grunt/Gulp/Broccoli/etc. - While I am not using it myself, from what I heard and read: It is a tool, that can help you automate numerous tasks, you would have to normally do manually. Anything ranging from compiling any CSS/HTML/JS preprocessor, concatenating different files together into one big file, watching for changes in files to automatically upload them to a server and so on. Basically it is a highly configurable tool meant to help you automate mundane and boring tasks.
Actually, NPM is a package manager what allows you to download a lot of packages of software such as Gulp and Grunt, but also Bootstrap etc with the command line. You have to install node.js for this. You don't need this as a front-end developer but it will make installing the software much easier than install it manually which take mostly more time.
https://docs.npmjs.com/getting-started/what-is-npm for npm
https://www.npmjs.com/browse/star for popular modules
Software such as Grunt and Gulp will help front-end developers mostly with compiling SASS and LESS, CSS preprocessors which saves you time and allows you to have more functions in your css. Grunt, Gulp etc runs in the command line and makes it easier to edit your files. For example, I use myself Gulp in combination with SASS. Because SASS has to compile to css I have set up a command which automatically compiles my SASS files to a CSS file if I hit the save button in my code editor, the SASS:Watch plugin.
I highly recommend using SASS, and so using Gulp or Grunt.
http://sass-lang.com/documentation/file.SASS_REFERENCE.html SASS documentation
http://gulpjs.com/ Gulp documentation
http://gulpjs.com/plugins/ plug ins for gulp
I am currently creating a portable consolidation of my workflow using Node-Webkit which has node.js embedded. Now my problem is getting grunt/gulp inside the project itself as it depends on the cli somewhat(avoidable, granted), and also is confusing to me on the architecture. Is it possible to find just a .js with grunt in it to include much like Jquery/Handlebars?
Is this all I need to just include and run?
No before that make sure you environment is up, get the package.json, GruntFile.js file. In GruntFile.js you can specify what you want to pre-process. For example jade,Less,coffee. It looks very much like a node function, for sample you can refer to link
Now to make this work you also need to install various contrib plugins as per your requirement. Then register every single task in GruntFile.js. It really speeds up the development.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.registerTask('test', ['jade', 'less','coffee']);
So to process less,jade,coffee, we need to run the module installations such as
npm install grunt --save-dev
npm install grunt <module name> --save-dev
There are many more interesting configurations to learn and documentation is really nice, please refer to getting started guide
This adds the required Grunt and grunt plugins to package.json
I am developing an python app on a Nitrous.io python box but I am using a grunt to build the front end. How can I install node, grunt and bower on a python box?
Grunt requires Node.JS version >=0.8.0 (source), and currently Nitrous.IO only offers Node.JS on the Node.JS templates (source).
As a workaround, you may want to look into building your Python project on a Node.JS template using Nitrous.IO. Along with NPM and Node.JS, the template also includes Python 2.7.3, pip, and virtualenv.
I have a blog built with Ruby, but I frequently blog about Objective-C topics.
I thus need a Ruby library that can take Objective-C source code strings and produce syntax-highlighted HTML output.
For Ruby source strings, I am happily using the syntax gem - http://syntax.rubyforge.org/ - but I can't find an Objective-C tokenizer for this library.
Is there an open source tokenizer available, or another library which can do this in Ruby?
If all else fails, all I've found is a PHP library (GeSHi) which claims to have Obj-C support, and I'll have to install PHP on my host, write a janky shell exec based invocation of it. I would love to avoid this. Thanks!
Well, you can just use a command line tool to do this and the best possible solution is surely Pygments, and if you're running on a Linux hosting you probably have Python installed already.
Just call it from the command line and store the output somewhere.
A little digging on Google led me to this gem, Highlight, which supports Objective-C. There are a few other Ruby gems listed here.