删除 node_modules

This commit is contained in:
2025-06-22 17:27:35 +08:00
parent ebcd00ed99
commit 912d2d4a12
3852 changed files with 0 additions and 1061355 deletions

View File

@@ -1,59 +0,0 @@
export type Options = {
/**
Change the output style.
When `false`, returns the value in a [recompilable source form](https://ss64.com/osx/osascript.html).
@default true
@example
```
import {runAppleScript} from 'run-applescript';
const result = await runAppleScript('return "unicorn"', {humanReadableOutput: false});
console.log(result);
//=> '"unicorn"'
```
*/
readonly humanReadableOutput?: boolean;
};
/**
Run AppleScript asynchronously.
@param script - The script to run.
@returns The script result.
@example
```
import {runAppleScript} from 'run-applescript';
const result = await runAppleScript('return "unicorn"');
console.log(result);
//=> 'unicorn'
```
*/
export function runAppleScript(
script: string,
options?: Options
): Promise<string>;
/**
Run AppleScript synchronously.
@param script - The script to run.
@returns The script result.
@example
```
import {runAppleScriptSync} from 'run-applescript';
const result = runAppleScriptSync('return "unicorn"');
console.log(result);
//=> 'unicorn'
```
*/
export function runAppleScriptSync(script: string, options?: Options): string;

View File

@@ -1,32 +0,0 @@
import process from 'node:process';
import {promisify} from 'node:util';
import {execFile, execFileSync} from 'node:child_process';
const execFileAsync = promisify(execFile);
export async function runAppleScript(script, {humanReadableOutput = true} = {}) {
if (process.platform !== 'darwin') {
throw new Error('macOS only');
}
const outputArguments = humanReadableOutput ? [] : ['-ss'];
const {stdout} = await execFileAsync('osascript', ['-e', script, outputArguments]);
return stdout.trim();
}
export function runAppleScriptSync(script, {humanReadableOutput = true} = {}) {
if (process.platform !== 'darwin') {
throw new Error('macOS only');
}
const outputArguments = humanReadableOutput ? [] : ['-ss'];
const stdout = execFileSync('osascript', ['-e', script, ...outputArguments], {
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'ignore'],
timeout: 500,
});
return stdout.trim();
}

View File

@@ -1,9 +0,0 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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.

View File

@@ -1,42 +0,0 @@
{
"name": "run-applescript",
"version": "7.0.0",
"description": "Run AppleScript and get the result",
"license": "MIT",
"repository": "sindresorhus/run-applescript",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"macos",
"mac",
"applescript",
"osascript",
"run",
"execute"
],
"devDependencies": {
"ava": "^6.0.1",
"tsd": "^0.30.0",
"xo": "^0.56.0"
}
}

View File

@@ -1,72 +0,0 @@
# run-applescript
> Run AppleScript and get the result
## Install
```sh
npm install run-applescript
```
## Usage
```js
import {runAppleScript} from 'run-applescript';
const result = await runAppleScript('return "unicorn"');
console.log(result);
//=> 'unicorn'
```
## API
### runAppleScript(script, options?)
Returns a `Promise<string>` with the script result.
#### script
Type: `string`
The script to run.
#### options
Type: `object`
##### humanReadableOutput
Type: `boolean`\
Default: `true`
Change the output style.
When `false`, returns the value in a [recompilable source form](https://ss64.com/osx/osascript.html).
### runAppleScriptSync(script, options?)
Returns a `string` with the script result.
#### script
Type: `string`
The script to run.
#### options
Type: `object`
##### humanReadableOutput
Type: `boolean`\
Default: `true`
Change the output style.
When `false`, returns the value in a [recompilable source form](https://ss64.com/osx/osascript.html).
## Related
- [run-jxa](https://github.com/sindresorhus/run-jxa) - Run JXA code and get the result