Does anyone know any good links on how to minify/compress javascript files using YUI Compressor in Windows? I am trying to figure out how to get it installed, then compress javascript using the msdos command line.
Thanks!
Install Nodejs for Windows
npm (node package manager) comes with the MSI you just grabbed and installed
Run npm install yuicompressor
Read the docs and compress files
I would recommend uglify-js over YUI Compressor since it is in a deprecation process. Same install as above.
You could also use gruntjs with grunt-contrib-uglify.
Related
I'm using npm to download libraries.
Is it correct to say that I'm using node.js ?
NPM is a package manager for Node.js packages, or modules.
NPM hosts thousands of free packages to download and use.
The NPM program is installed on your computer when you install Node.js
Node.js As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.
https://nodejs.org/en/about/
Node.js is all about modularity, and with that comes the need for a quality package manager; for this purpose, npm was made. With npm comes the largest selection of community-created packages of any programming ecosystem, which makes building Node.js apps quick and easy.
https://nodejs.org/en/docs/meta/topics/dependencies/#npm
Hope I helped you see the differences.Best Regards !
Yes nodejs is a runtime environment for javascript docs here like JRE is for java. You can use Node to run javascript in you system otherwise you need a browser to run it
NPM is a library for javascript read here, you use that to install libraries incase you need to use some extra features you dont wanna code yourself
Nodejs can run w/o use of npm like you can use other library repo like yarn likewise you can use other run time environment like Deno and use npm with that w/o using node
I'm trying to use the command line tools of UglifyJs to minify my files. On the git page it says to download it using npm: npm install uglify-js -g.
Is that the only way to download it? My website doesn't use node.js so I'm wondering if there's an alternate way.
You can download it directly from it's github repo. However, I do agree with JohnnyHK it's better to install via npm as it will handle any dependancies required by UglifyJS.
When installing a module using npm -g, you're installing a command-line utility that uses node.js for its run-time rather than a module for a node.js based web site.
So it's still easiest to use npm to install it.
Hi,
I have finished to code my website using lesscss client side and now want to compile less so I have donwloaded node.js. My website is running on localhost and I want first to know:
where I have to install node.js
what I have to do next ( commands lines tools, commands lines etc. ).
If someone can help me because I'm a newbie in this field.
Thanks.
You can install the LESS compiler directly from npm.
Install node.js. Go to this page and download the installer for your platform.
If you're on Windows, download the .msi; if you are on OSX, download the .pkg file. Whenever possible, download the 64-bit version (unless your system is running only 32-bit hardware and software). If you are on Linux and you want to use package managers, see this page.
Once you have node.js installed, you should also have npm, which is node.js Package Manager. You can open a terminal/console and run npm -v to make sure everything is installed correctly.
Eventually, you can install the LESS compiler by simply executing:
npm install -g less
(note: on OSX and Linux you may need to run this with sudo: sudo npm install -g less).
The LESS compiler will then be available as the lessc command. See examples here.
PS: Some GUIs also exist for simplifying working with lessc. Google "less gui windows/mac/linux" to see many results, like this one for Mac.
it's not mentioned what to do after installing node.js and installing less compiler on your node.
Go to your folder where you are hosting your project locally and then type styles. less styles.css. This should initiate the conversion from less to CSS at the node command prompt.
I'm running an educational project where kids needs to install node and some packages themselves before they start. I want to make it super simple for them to do themselves. Right now it's a matter of:
Download and install Node as a .msi or .pkg
Run some npm install command in a terminal which is less friendly.
Is there any way to bundle some packages with node and create one simple download that will just work?
I know that node webkit is able to do what you need, and even more; if you opt on it, you will probably find other useful features for your purpose.
after a few tries I successfully install nodejs in windows with cygwin...
And when I find out that I can't install npm in windows, I wonder...
How can I install the Stylus manually??
I downloaded the files from the Stylus Github Site
Where do I copy them??
What commands should I use in the cgywin to install it??
Not sure if this is too late, but good news everyone! NPM runs on windows without cygwin now :-)
http://npmjs.org/doc/README.html