You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 11, 2023. It is now read-only.
The library to scrape and manage snippets from some text.
Install
npm i textvarify
How to use
import{Snippet}from"textvarify/lib/snippet";import{SnippetBorder}from"textvarify/lib/models/borders";consttext='Hello, {{user}}, i am a demo case.';snippet=newSnippet(SnippetBorder.BRACE,2);// init snippet as {{snippet}}scraper=newScraper(snippet);// init scraperconstvalues=scraper.getAllValues(text);// values = ['user'];constborderValues=scraper.getAllValuesWithBorder(text);// borderValues = ['{{user}}'];constmaching=scraper.isMatch(text);// maching = true; there is at least one snippet in the text.