@krobkrong/resources-utilities
TypeScript icon, indicating that this package has built-in type declarations

0.1.16 • Public • Published

npm npm test coverage node-sass webpack Codacy Badge

resources-utilities

A command line and library to generate typescript definition file from CSS, SASS, SCSS or SVG file.

Install

Using NPM

npm i -D @krobkrong/resources-utilities

Using Yarn

yarn add @krobkrong/resources-utilities -D

Command Line Usage

Resource utilities provide a command line that accept the last argument with glob pattern input syntax. For example, the command line below will generate a typescript definition file from a CSS file in the current work directory:

resutil theme*.css

If you've a specific location to store typescript definition file then you can use output directory option:

resutil -o types theme*.css

The command above will generate the typescript definition file in the folder types in the current working directory.

For more information run resutil --help

APIs Usage

Resource utilities provided APIs for both CSS and SVG. The below code utilize StyleUtils namespace to parse raw css file:

import { StyleUtils } from "@krobkrong/resources-utilities";

let resource = StyleUtils.parse(raw, {
   convension: "camel",
   cssClass: true,
   cssId: true,
   cssVariable: true
})

Package Sidebar

Install

npm i @krobkrong/resources-utilities

Weekly Downloads

0

Version

0.1.16

License

Apache-2.0

Unpacked Size

228 kB

Total Files

60

Last publish

Collaborators

  • sreng.veasna