Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

jsx-tokenizer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-tokenizer

jsx-tokenizer to transform words into tokens

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
13
62.5%
Maintainers
1
Weekly downloads
 
Created
Source

jsx-tokenizer 介绍 (presentation)

使用有限状态机思想进行词法解析,将 jsx 代码处理成 tokens 片段。词法解析阶段不校验代码的合法性,代码合法性在语法解析阶段校验。

有限状态机实现 JSX 词法分析 这篇博客对 jsx-tokenizer 的实现思路有更详细的介绍,感兴趣的同学可点击了解。

jsx-tokenizer is written to be the example to show how to use finite-state machine mode to analysis jsx statement.

安装 (how to install)

  npm i jsx-tokenizer

使用(how to use)

const { tokenizer } = require('jsx-tokenizer')
let sourceCode =
  '<h1 id="title" style="background: green;"><span>hello</span>world</h1>'
console.log('tokenizer词法解析结果:', tokenizer(sourceCode))

其他(others)

有疑问欢迎在 github 下留言讨论,也可以联系作者邮箱:kinyaying@gmail.com

if you want to discuss the details of jsx-tokenizer, please leave words on github. Or you can concat the author, you can email me at kinyaying@gmail.com.

Keywords

jsx-tokenizer

FAQs

Package last updated on 21 Dec 2020

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