Get Started
The API Documentation for utils-snap-fn.
utils-snap-fnis Front-end tool function code snippets with fulltypescriptsupport, have many useful functions. You can use these inVue,Svelte,Reactfiles, try it!
🏗️ Installation
bash
# npm
npm i utils-snap-fn -D
# yarn
yarn add utils-snap-fn -D
# pnpm
pnpm add utils-snap-fn -D⚓ Usage Example
1. On-demand Import
js
import { isPhoneNum } from 'utils-snap-fn'2. Full Import
js
import * as snapFn from 'utils-snap-fn'
// example
snapFn.isPhoneNum('18811112222') // true
snapFn.isPhoneNum('28811112222') // false3. CDN
You can download the utils-snap-fn.browser.js file from the lib directory and use it directly. It also supports CDN, so you can include it in your HTML file through the CDN link
js
// <script src="./js/utils-snap-fn.browser.js"></script>
isPhoneNum('13344445555') // true4. CJS
You can download the utils-snap-fn.cjs.js file from the lib directory and use it directly. It is designed to be used in a Node.js environment, so you can import it in your Node.js code