Initial commit: New MoreminiMore website with fresh design
This commit is contained in:
21
node_modules/tinyclip/LICENSE
generated
vendored
Normal file
21
node_modules/tinyclip/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Tinylibs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
35
node_modules/tinyclip/README.md
generated
vendored
Normal file
35
node_modules/tinyclip/README.md
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# tinyclip 📋
|
||||
|
||||
A tiny cross-platform clipboard library. Uses native OS clipboard functionality on Node.js.
|
||||
|
||||
> [!NOTE]
|
||||
> In the browser, you can use the native [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API) instead of a dependency.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install tinyclip
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import {readText, writeText} from 'tinyclip';
|
||||
|
||||
await writeText('hello world');
|
||||
const text = await readText();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `readText(): Promise<string>`
|
||||
|
||||
Reads text from the clipboard.
|
||||
|
||||
### `writeText(text: string): Promise<void>`
|
||||
|
||||
Writes text to the clipboard.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
8
node_modules/tinyclip/dist/index.d.ts
generated
vendored
Normal file
8
node_modules/tinyclip/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Reads text from the clipboard.
|
||||
*/
|
||||
export declare function readText(): Promise<string>;
|
||||
/**
|
||||
* Writes text to the clipboard.
|
||||
*/
|
||||
export declare function writeText(text: string): Promise<void>;
|
||||
100
node_modules/tinyclip/dist/index.js
generated
vendored
Normal file
100
node_modules/tinyclip/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
const TIMEOUT = 2000;
|
||||
function checkUnixCommandExists(command) {
|
||||
return new Promise((resolve) => {
|
||||
const proc = spawn('which', [command]);
|
||||
proc.on('error', () => resolve(false));
|
||||
proc.on('close', (code) => resolve(code === 0));
|
||||
});
|
||||
}
|
||||
async function getReadCommand() {
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
return ['pbpaste', []];
|
||||
case 'win32':
|
||||
return ['powershell', ['Get-Clipboard']];
|
||||
case 'linux':
|
||||
case 'freebsd':
|
||||
case 'openbsd':
|
||||
if (process.env.WSL_DISTRO_NAME) {
|
||||
return ['powershell.exe', ['-noprofile', '-command', 'Get-Clipboard']];
|
||||
}
|
||||
if (process.env.WAYLAND_DISPLAY) {
|
||||
return ['wl-paste', []];
|
||||
}
|
||||
if (await checkUnixCommandExists('xsel')) {
|
||||
return ['xsel', ['--clipboard', '--output']];
|
||||
}
|
||||
return ['xclip', ['-selection', 'clipboard', '-o']];
|
||||
case 'android':
|
||||
return ['termux-clipboard-get', []];
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Reads text from the clipboard.
|
||||
*/
|
||||
export function readText() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const command = await getReadCommand();
|
||||
if (!command) {
|
||||
return reject(new Error('No clipboard tool found'));
|
||||
}
|
||||
const proc = spawn(...command, {
|
||||
signal: AbortSignal.timeout(TIMEOUT)
|
||||
});
|
||||
let data = '';
|
||||
proc.stdout.on('data', (chunk) => (data += chunk));
|
||||
proc.on('error', (cause) => reject(new Error('An error occurred while reading from clipboard', { cause })));
|
||||
proc.on('close', (code) => code === 0
|
||||
? resolve(data.trim())
|
||||
: reject(new Error('An unknown error occurred while reading from clipboard')));
|
||||
});
|
||||
}
|
||||
async function getWriteCommand() {
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
return ['pbcopy', []];
|
||||
case 'win32':
|
||||
return ['clip', []];
|
||||
case 'linux':
|
||||
case 'freebsd':
|
||||
case 'openbsd':
|
||||
if (process.env.WSL_DISTRO_NAME) {
|
||||
return ['clip.exe', []];
|
||||
}
|
||||
if (process.env.WAYLAND_DISPLAY) {
|
||||
return ['wl-copy', []];
|
||||
}
|
||||
if (await checkUnixCommandExists('xsel')) {
|
||||
return ['xsel', ['--clipboard', '--input']];
|
||||
}
|
||||
return ['xclip', ['-selection', 'clipboard', '-i']];
|
||||
case 'android':
|
||||
return ['termux-clipboard-set', []];
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Writes text to the clipboard.
|
||||
*/
|
||||
export function writeText(text) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const command = await getWriteCommand();
|
||||
if (!command) {
|
||||
return reject(new Error('No clipboard tool found'));
|
||||
}
|
||||
const proc = spawn(...command, {
|
||||
stdio: ['pipe', 'ignore', 'ignore'],
|
||||
signal: AbortSignal.timeout(TIMEOUT)
|
||||
});
|
||||
proc.on('error', (cause) => reject(new Error('An error occurred while copying', { cause })));
|
||||
proc.on('close', (code) => code === 0
|
||||
? resolve()
|
||||
: reject(new Error('An unknown error occurred while copying')));
|
||||
proc.stdin.write(text);
|
||||
proc.stdin.end();
|
||||
});
|
||||
}
|
||||
48
node_modules/tinyclip/package.json
generated
vendored
Normal file
48
node_modules/tinyclip/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "tinyclip",
|
||||
"packageManager": "pnpm@10.30.1",
|
||||
"version": "0.1.12",
|
||||
"description": "A tiny utility to interact with the system clipboard.",
|
||||
"keywords": [
|
||||
"clipboard",
|
||||
"copy",
|
||||
"paste"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://github.com/tinylibs/tinyclip#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/tinylibs/tinyclip/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/tinylibs/tinyclip.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Tinylibs Maintainers (https://github.com/tinylibs)",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.14.0 || >= 17.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsgo --build",
|
||||
"test": "vitest run",
|
||||
"format": "prettier --write .",
|
||||
"lint": "pnpm lint:format",
|
||||
"lint:format": "prettier --check ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.3.3",
|
||||
"@typescript/native-preview": "^7.0.0-dev.20260228.1",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"prettier": "^3.7.4",
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user