Skip to content
No description or website provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
test
.gitignore
.testem.json
.travis.yml
LICENCE
README.md
index.js
less.js
package.json
serve.js

README.md

npm-less

Fix LESS to import a la node require algorithm

Example

var http = require("http")
var path = require("path")
// Simple http router
var Router = require("routes-router")
// Simple static file server
var ecstatic = require("ecstatic")

var ServeLess = require("npm-less/serve")

var router = Router()

// ServeLess(rootFolder) returns a http handler
// to server less files. The suggestion is to
// serve /less/foo as /styles/foo/index.js or
// /less/bar as /styles/bar.js
router.addRoute("/less/:appName",
    ServeLess(path.join(__dirname, "styles")))
// static server to serve html page for example
router.addRoute("/", ecstatic({
    root: path.join(__dirname, "static"),
    autoIndex: true
}))

var server = http.createServer(router)

server.listen(9024, function () {
    console.log("demo server listening on port 9024")
})

Installation

npm install npm-less

Contributors

  • Raynos

MIT Licenced

Something went wrong with that request. Please try again.