Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
一个含有a标签的字符串,解析出元素,
let mockStr = `您的快件<a href="www.baidu.com" target="_blank" >zjs2u38u28347</a>已经发出,
如果需要查询,请访问我们的<a href="www.sina.com" target="_blank" >网站</a>或微信咨询,或官方渠道`;
const extractA = require('extract-a');
let nodesArray = extractA(mockStr);
console.log(nodesArray);
// npm run test
输入=>
您的快件<a href="www.baidu.com" target="_blank" >zjs2u38u28347</a>已经发出,
如果需要查询,请访问我们的<a href="www.sina.com" target="_blank" >网站</a>或微信咨询,或官方渠道
输出=>
[ { type: 'text', content: '您的快件' },
{ type: 'link', content: 'zjs2u38u28347', href: 'www.baidu.com' },
{ type: 'text', content: '已经发出,\n如果需求查询,请访问我们的' },
{ type: 'link', content: '网站', href: 'www.sina.com' },
{ type: 'text', content: '或微信咨询,或官方聚到' } ]
FAQs
extract a element from a string
The npm package extract-a receives a total of 2 weekly downloads. As such, extract-a popularity was classified as not popular.
We found that extract-a demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.