New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-less-endpoint

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-less-endpoint

Easily serve LESS css assets on express

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-less-endpoint

Easily serve a LESS file as CSS from an express endpoint. No grunt/gulp, no build files, no required configuration – just pure data.

Dependencies

  • LESS (taken care of by npm install)
  • ES6 Object.assign (either use node v4.0+ or a polyfill)

Installation

$ npm install node-less-endpoint --save

Usage - Easy Version

Assuming you have the following directory structure:

client/
└── app.less

server/
└── index.js

package.json

Then you can write the following as your server/index.js:

// server.js
var LESS = require('node-less-endpoint');
var app  = require('express')();

app.get('/assets/app-bundle.css',
  LESS.serve('./client/app.less'));

console.log("Listening on port 5555...");
app.listen(5555);

And run node server/index.js.

Now any GET request to localhost:5555/app.css will compile and serve the LESS file located at ./client/app.less. Any @import statements within app.less will also be included in the final output.

Advanced Usage

app.get(
  '/app.css',
  LESS.serve('./client/app.less', {

    // (dev only) defaults to parent folder of LESS file.
    // Any LESS file changes in this directory will clear the output cache.
    watchDir: './client/',

    // Defaults to parent folder of the LESS file you specify.
    // The node_modules/ is always included.
    includePaths: ['./client/'],

    // Defaults to false
    debug: false
  })
);

FAQs

Package last updated on 04 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc