0.1.2 • Published 4 months ago

@vyke/transform-to-elements v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Helper functions to transform code into @vyke/elements

Installation

npm i @vyke/transform-to-elements

or you can use the interactive website

API

markupToNodes

Converts markup into nodes, useful to manipulated the code before converting it to elements

import { markupToNodes } from '@vyke/transform-to-elements'

const nodes = markupToNodes('<div><p>test</p></div>')
//      ^? Node[]

markupToElements

Converts a given markup to elements

import { markupToElements } from '@vyke/transform-to-elements'

const elements = markupToElements('<div><p>test</p></div>')
//       ^? { code: string[], tags: string[] }
// where code is each line of the output
// and tags is the list of elements found

nodesToElements

Converts nodes to elements to generate elements using the output of markupToNodes

import { markupToNodes } from '@vyke/transform-to-elements'

const nodes = markupToNodes('<div><p>test</p></div>')
//      ^? Node[]

const elements = nodesToElements(nodes); // same output as markupToElements

Inspiration and Credits

0.1.2

4 months ago

0.1.0

5 months ago

0.1.1

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.3

5 months ago