Node.js Express Script to Convert Sass (SCSS) to CSS Online App Using Node-Sass Library Full Project For Beginners

You are currently viewing Node.js Express Script to Convert Sass (SCSS) to CSS Online App Using Node-Sass Library Full Project For Beginners

 

 

 

Welcome folks today in this folks we will be making online app of converting scss to css online tool using node-sass library. All the source code of the application is given below.

 

 

Live Demo

 

 

You can check out the live demo of this tool here

 

 

 

Screenshot

 

 

 

 

 

 

 

 

Get Started

 

 

 

In order to get started we need to install the node-sass library globally inside our system.

We will execute the following commands

 

npm init -y

 

This will create a package.json file inside your root directory

 

And now we need to install node-sass inside node.js project

 

npm i -g node-sass

 

This will work only for windows

 

In order to install on linux or ubuntu

 

we need to execute the below command

 

sudo npm install -g --unsafe-perm node-sass

 

 

 

Converting SCSS to CSS

 

 

 

Now using this library we will be converting scss to css library. We need to execute the following command

 

node-sass input.scss output.css

 

here we are taking the input sass file input.scss and converting to output css file output.css

 

 

 

Source Code

 

 

Now just install the following dependencies

 

npm i express

 

npm i nodemon

 

npm i ejs

 

npm i multer

 

After installing all these dependencies make a index.js file and copy paste the following code

 

 

index.js

 

 

 

 

 

Now make a views folder inside the root directory and inside it create a scsstocss.ejs file and copy paste the following code

 

 

views/scsstocss.ejs

 

 

 

 

 

Leave a Reply