read-css

0.3.0 • Public • Published

read-css

Read a CSS file into an AST. AST format is from the css.parse method. Methods work like fs.readFile and fs.readFileSync. If you supply a callback, method will be async. If not, method will be sync.

install

npm install read-css

usage

const read = require('read-css')

sync usage

read('example.css') // tree

async usage

const callback = (err, data) => {
  if (err) throw err
  console.log(JSON.stringify(data, null, 2))
}
 
read('example.css', callback)

output

const read = require('read-css')
read('test.css')

View sample AST output in test.json

develop

npm install
npm test

related

reap-css

/read-css/

    Package Sidebar

    Install

    npm i read-css

    Weekly Downloads

    18

    Version

    0.3.0

    License

    ISC

    Last publish

    Collaborators

    • ryanve