Socket
Socket
Sign inDemoInstall

@types/less

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/less

TypeScript definitions for LESS


Version published
Weekly downloads
252K
increased by4.32%
Maintainers
1
Weekly downloads
 
Created

What is @types/less?

@types/less provides TypeScript type definitions for the Less CSS preprocessor, allowing developers to use Less in TypeScript projects with type safety and autocompletion.

What are @types/less's main functionalities?

Compiling Less to CSS

This feature allows you to compile Less code into CSS. The code sample demonstrates how to use the Less compiler to convert a Less string into CSS.

const less = require('less');
const input = '.class { width: (1 + 1) }';
less.render(input, (e, output) => {
  console.log(output.css);
});

Using Less with options

This feature allows you to compile Less code with additional options such as compression. The code sample shows how to pass options to the Less compiler.

const less = require('less');
const input = '.class { width: (1 + 1) }';
const options = { compress: true };
less.render(input, options, (e, output) => {
  console.log(output.css);
});

Handling errors

This feature demonstrates how to handle errors during the Less compilation process. The code sample shows how to catch and log errors.

const less = require('less');
const input = '.class { width: (1 + 1) }';
less.render(input, (e, output) => {
  if (e) {
    console.error(e);
  } else {
    console.log(output.css);
  }
});

Other packages similar to @types/less

FAQs

Package last updated on 12 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