Socket
Book a DemoInstallSign in
Socket

gradient-parser

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gradient-parser

Parse CSS3 gradient definitions and return an AST.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created

What is gradient-parser?

The gradient-parser npm package is a utility for parsing CSS gradient strings into a structured JSON format. It allows developers to easily interpret and manipulate gradient definitions in their applications.

What are gradient-parser's main functionalities?

Parsing CSS Gradients

This feature allows you to parse a CSS gradient string into a JSON object. The code sample demonstrates how to use the gradient-parser to convert a linear gradient string into a structured JSON format, which can then be used for further processing or manipulation.

const gradientParser = require('gradient-parser');
const gradientString = 'linear-gradient(to right, #ff0000, #00ff00, #0000ff)';
const parsedGradient = gradientParser.parse(gradientString);
console.log(JSON.stringify(parsedGradient, null, 2));

Other packages similar to gradient-parser

Keywords

library

FAQs

Package last updated on 20 Apr 2025

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