0.2.9 • Published 8 months ago
@toolsntuts/utils v0.2.9
Svelte Util Functions
It makes use of the following technologies
Installation
npm i @toolsntuts/utilsConfiguration
Update your vite.config.ts file in your sveltekit application with the following
import { defineConfig } from 'vitest/config';
import { sveltekit } from '@sveltejs/kit/vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
fs: {
allow: [
'dist', // Allow access to the dist folder
'.', // Allow access to the project root
'src' // Allow access to src if needed
]
}
}
});timeAgo()
Accepts number input and returns string output
const date = +new Date("November 2, 2024")
const time = timeAgo(date) // returns 1 day agoslugify()
Accepts string input and returns string output
const email = "example@test.com"
const slugified = slugify(email) // returns exampletestcomgetFolderName()
Wrapper for slugify
emailToTag()
Accepts email string returns a tag string
const email = "example@test.com"
const slugified = emailToTag(email) // returns @examplemediaUrlFormat()
Accepts email string returns a tag string
const media = "<MEDIA_FILE_NAME>.jpg"
const urlFormat = mediaUrlFormat(media) // returns .jpg0.2.9
8 months ago
0.2.8
9 months ago
0.2.7
9 months ago
0.2.6
9 months ago
0.2.3
10 months ago
0.2.5
9 months ago
0.2.4
10 months ago
0.1.8
10 months ago
0.1.9
10 months ago
0.2.2
10 months ago
0.1.6
10 months ago
0.1.2
11 months ago
0.1.4
11 months ago
0.1.5
11 months ago
0.1.0
11 months ago
0.1.1
11 months ago
0.0.8
11 months ago
0.0.7
12 months ago
0.0.6
12 months ago
0.0.5
1 year ago
0.0.4
1 year ago
0.0.3
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago