1.13.4 • Published 10 months ago

@jkob/browser v1.13.4

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Using clipboard

import { clipboard } from "@jkob/browser";
await clipboard.write("text to copy");
const copied = await clipboard.read();

Speech synthesis in browser

import { speech } from "@jkob/browser";
speech.speak("Hello"); // command are queued

LocalStorage, SessionStorage

import { LocalStorage, SessionStorage } from "@jkob/browser";
LocalStorage.get("key");
LocalStorage.set("key", "value"); // value can be anything

Vibration

import { vibrate } from "@jkob/browser";
vibrate(500);
vibrate([500, 200, 500]);

Fetchy API

import { Fetchy } from "@jkob/browser";

const fetchy = new Fetchy("https://website.com/api");

// regular GET request
// calls "https://website.com/api/users", returns something like { status: 200, data: [] }
const response = await fetchy.get({ path: "/users" });

// with params
// calls "https://website.com/api/users?id=14", returns something like { status: 200, data: [] }
const response = await fetchy.get({ path: "/users", params: { id: 14 } });

// POST request with data
const response = await fetchy.post({ path: "/user", data: { name: "John" } });

// additional headers (default ones has json support already!)
const response = await fetchy.post({
	path: "/user",
	data: { name: "John" },
	headers: { Authorization: "Bearer: xx...." },
});
1.13.2

10 months ago

1.13.1

10 months ago

1.13.0

10 months ago

1.12.0

10 months ago

1.13.4

10 months ago

1.13.3

10 months ago

1.11.0

1 year ago

1.10.1

2 years ago

1.10.0

2 years ago

1.9.6

2 years ago

1.9.5

2 years ago

1.9.3

2 years ago