# js-string-parser **Repository Path**: nexusli/js-string-parser ## Basic Information - **Project Name**: js-string-parser - **Description**: 提取 js 代码中所有字符串、以及所有注释字符串 并包含其 from,to 定位 - **Primary Language**: JavaScript - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-24 - **Last Updated**: 2022-04-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: JavaScript ## README # js-string-parser #### 介绍 提取 js 代码中所有字符串、以及所有注释字符串 并包含其 from,to 定位 #### 例:text.js-body // some body; let name = 'li shuang'; /* sayHello function */ function sayHello (val) { alert('hello' + val); } sayHello(name) -------------------------------------------------------- parser-result: 1. some body - type - multiline-comment 2. 'li shuang' - type value 3. sayHello function - type comment 4. 'hello' - type value #### 软件架构 软件架构说明 #### 安装教程 1. npm i js-string-parser #### 使用说明 1. import JsParse from 'js-string-parser' 2. * @description parse * @param {String} token - Some jsCode * @return {Array} * Array-item.type = [comment|multiline-comment|value] const jsParse = new JsParse() jsParse.parse(token)