Opinionated collection of common JavaScript / TypeScript utils by @chengpeiquan .
🌳 Fully tree shakeable
💪 Type Strong
💡 No bundler required
🦄 SSR Friendly
Usage
With npm(or yarn, or pnpm):
npm install @bassist/utils
In .js / .ts or other files:
import { isMobile } from '@bassist/utils'
if (isMobile()) {
// do something...
}
With CDN:
<script src="https://cdn.jsdelivr.net/npm/@bassist/utils"></script>
<script>
// All methods are on the `Utils` variable
console.log(Utils)
if (Utils.isMobile()) {
// do something...
}
</script>