{"id":26002,"library":"node-less","title":"node-less","description":"A minimal Node.js wrapper around the Less CSS preprocessor, allowing compilation of .less files to CSS programmatically and via command-line. Version 1.0.0 is the initial release with basic compilation support. No longer maintained; users should switch to the official 'less' npm package which is actively developed and includes all features.","status":"deprecated","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","css","less"],"install":[{"cmd":"npm install node-less","lang":"bash","label":"npm"},{"cmd":"yarn add node-less","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-less","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is deprecated; use 'less' package instead. ESM import shown for clarity.","wrong":"const less = require('node-less')","symbol":"node-less","correct":"import less from 'node-less'"},{"note":"The API is synchronous; no promise or callback needed.","wrong":"const { compile } = require('node-less'); compile('.class { color: red; }')","symbol":"less.compile","correct":"import less from 'node-less'; const css = less.compile('.class { color: red; }')"},{"note":"render() expects string input, not file path. For file compilation, use CLI or migrate to 'less' package.","wrong":"less.renderFile('style.less', callback)","symbol":"less.render","correct":"import less from 'node-less'; less.render('.a { .b { color: red; } }')"}],"quickstart":{"code":"import less from 'node-less';\n\nconst input = `\n@base: #f938ab;\n.box {\n  color: @base;\n  border-color: darken(@base, 10%);\n}\n`;\n\ntry {\n  const output = less.compile(input);\n  console.log(output);\n} catch (err) {\n  console.error('Compilation error:', err);\n}","lang":"javascript","description":"Shows basic usage of less.compile() to process Less source and produce CSS output synchronously."},"warnings":[{"fix":"npm uninstall node-less && npm install less","message":"This package is no longer maintained. Use official 'less' package instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Migrate to 'less' package's render() for full feature set.","message":"compile() does not support options like paths or plugins.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Wrap in try-catch block. For async usage, use official 'less' package's renderAsync.","message":"render() returns a string, not a promise. It throws synchronously on error.","severity":"gotcha","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install less","cause":"Missing peer dependency 'less'.","error":"Error: Cannot find module 'less'"},{"fix":"Use `import less from 'node-less'` then call `less.compile(input)`.","cause":"Incorrect import style; default export is an object, not a function.","error":"less.compile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}