Socket
Socket
Sign inDemoInstall

grid-template-parser

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grid-template-parser

A simple CSS Grid template parser


Version published
Maintainers
1
Install size
10.2 kB
Created

Readme

Source

grid-template-parser Build Status

A simple CSS Grid template parser

Installation

npm install --save grid-template-parser

Basic usage

import {grid} from 'grid-template-parser';

const areas = grid(`
  "a a a b b"
  "a a a b b"
  ". . c c c"
  "d d d d d"
`);

// → {
//   a: {
//     column: { start: 1, end: 4, span: 3 },
//     row: { start: 1, end: 3, span: 2 },
//   },
//   b: {
//     column: { start: 4, end: 6, span: 2 },
//     row: { start: 1, end: 3, span: 2 },
//   },
//   c: {
//     column: { start: 3, end: 6, span: 3 },
//     row: { start: 3, end: 4, span: 1 },
//   },
//   d: {
//     column: { start: 1, end: 6, span: 5 },
//     row: { start: 4, end: 5, span: 1 },
//   },
// }

License

MIT

Keywords

FAQs

Last updated on 26 Mar 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc