Javascript: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 38: Line 38:
$ PATH=/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin:$PATH; export PATH
$ PATH=/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin:$PATH; export PATH


$ # Method 1. Install less via npm. No sudo required
$ npm install -g less
$ npm install -g less
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/lessc -> /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/less/bin/lessc
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/lessc -> /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/less/bin/lessc
Line 49: Line 50:


$ # Less
$ # Method 2. Install less via bow (depending on npm). No sudo required
$ wget https://github.com/less/less.js/archive/v2.6.1.zip
$ npm install -g bower
$ unzip v2.6.1.zip
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/bower -> /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/bower/bin/bower
$ cd less.js-2.6.1
[email protected] /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/bower
$ ls
$ which bower
appveyor.yml  bower.json  build.gradle    dist    gradlew.bat  lib           README.md
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/bower
benchmark    browser.js  CHANGELOG.md    gradle  Gruntfile.js  LICENSE      test
$ bower install less
bin          build       CONTRIBUTING.md  gradlew  index.js     package.json
bower not-cached    https://github.com/less/less.git#*
$ ls bin
bower resolve      https://github.com/less/less.git#*
lessc
bower checkout      less#v2.7.1
bower resolved      https://github.com/less/less.git#2.7.1
bower install      less#2.7.1
 
$ ls -l /home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin
total 21740
lrwxrwxrwx 1 odroid odroid      35 Jun 12 07:23 bower -> ../lib/node_modules/bower/bin/bower
lrwxrwxrwx 1 odroid odroid      34 Jun 12 07:32 lessc -> ../lib/node_modules/less/bin/lessc
-rwxr-xr-x 1 odroid odroid 22261036 May 24 13:30 node
lrwxrwxrwx 1 odroid odroid       38 May 24 13:30 npm -> ../lib/node_modules/npm/bin/npm-cli.js
</syntaxhighlight>
</syntaxhighlight>
As you can see all node.js packages are installed under the node directory. If ''node-v4.4.5-linux-armv7l/bin'' was added to $PATH in .bashrc after we install nodejs, we won't need to include all other binary directories (installed via npm) to $PATH individually.

Revision as of 06:43, 12 June 2016

Some resources

Book

Libraries

jQuery UI

It is mentioned in Creating multi-tab reports with R and jQuery UI

npm - node.js package manager

sudo apt-get install npm

Less

Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.

Less runs inside Node, in the browser and inside Rhino.

Installation

$ npm install -g less
npm http GET https://registry.npmjs.org/less
npm http 304 https://registry.npmjs.org/less
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"v0.10.25","npm":"1.3.10"})

$ # Install the current version of node/nodejs for my OS (ARM v7). https://nodejs.org/en/download/
$ wget https://nodejs.org/dist/v4.4.5/node-v4.4.5-linux-armv7l.tar.xz | tar xJ
$ PATH=/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin:$PATH; export PATH

$ # Method 1. Install less via npm. No sudo required
$ npm install -g less
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/lessc -> /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/less/bin/lessc
[email protected] /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/less
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected])

$ # Method 2. Install less via bow (depending on npm). No sudo required
$ npm install -g bower
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/bower -> /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/bower/bin/bower
[email protected] /home/odroid/Downloads/node-v4.4.5-linux-armv7l/lib/node_modules/bower
$ which bower
/home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin/bower
$ bower install less
bower not-cached    https://github.com/less/less.git#*
bower resolve       https://github.com/less/less.git#*
bower checkout      less#v2.7.1
bower resolved      https://github.com/less/less.git#2.7.1
bower install       less#2.7.1

$ ls -l /home/odroid/Downloads/node-v4.4.5-linux-armv7l/bin
total 21740
lrwxrwxrwx 1 odroid odroid       35 Jun 12 07:23 bower -> ../lib/node_modules/bower/bin/bower
lrwxrwxrwx 1 odroid odroid       34 Jun 12 07:32 lessc -> ../lib/node_modules/less/bin/lessc
-rwxr-xr-x 1 odroid odroid 22261036 May 24 13:30 node
lrwxrwxrwx 1 odroid odroid       38 May 24 13:30 npm -> ../lib/node_modules/npm/bin/npm-cli.js

As you can see all node.js packages are installed under the node directory. If node-v4.4.5-linux-armv7l/bin was added to $PATH in .bashrc after we install nodejs, we won't need to include all other binary directories (installed via npm) to $PATH individually.