https://github.com/alshdavid/kit
https://github.com/alshdavid/kit
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/alshdavid/kit
- Owner: alshdavid
- License: mit
- Created: 2023-05-13T02:06:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-15T03:13:11.000Z (over 1 year ago)
- Last Synced: 2025-02-15T03:23:54.583Z (over 1 year ago)
- Language: TypeScript
- Size: 272 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JavaScript Kit Utils
```
npm install @alshdavid/kit
```
```typescript
import { sha256 } from '@alshdavid/kit/crypto'
void (async function main() {
const foo = await sha256('foo')
})()
```
From the browser
```javascript
const kit = await import(
'https://cdn.jsdelivr.net/npm/@alshdavid/kit@latest/browser/esm/index.js'
)
await kit.localStorage.setItem('foo', 'bar')
kit.log(await alshx.localStorage.getItem('foo'))
// Also automatically added to globalThis
await alshx.localStorage.setItem('foo', 'bar')
console.log(await alshx.localStorage.getItem('foo'))
```
```html
{
"imports": {
"@alshx/kit/": "https://cdn.jsdelivr.net/npm/@alshdavid/kit@latest/browser/esm/"
}
}
import * as preact from '@alshx/kit/preact.js'
console.log(preact)
import * as kit from '@alshx/kit/index.js'
console.log(kit)
```