Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

escape-string-applescript

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

escape-string-applescript - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

9

index.js

@@ -1,2 +0,7 @@

'use strict';
module.exports = x => typeof x === 'string' ? x.replace(/[\\"]/g, '\\$&') : x;
export default function escapeStringAppleScript(string) {
if (typeof string !== 'string') {
throw new TypeError(`Expected a string, got ${typeof string}`);
}
return string.replace(/[\\"]/g, '\\$&');
}
{
"name": "escape-string-applescript",
"version": "2.0.0",
"description": "Escape a string for use in AppleScript",
"license": "MIT",
"repository": "sindresorhus/escape-string-applescript",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"escape",
"string",
"str",
"applescript",
"osascript",
"quote",
"quotes",
"backslash"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "escape-string-applescript",
"version": "3.0.0",
"description": "Escape a string for use in AppleScript",
"license": "MIT",
"repository": "sindresorhus/escape-string-applescript",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"escape",
"string",
"applescript",
"osascript",
"quote",
"quotes",
"backslash"
],
"devDependencies": {
"ava": "^3.15.0",
"xo": "^0.38.2"
}
}

@@ -1,2 +0,2 @@

# escape-string-applescript [![Build Status](https://travis-ci.org/sindresorhus/escape-string-applescript.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-applescript)
# escape-string-applescript

@@ -7,20 +7,18 @@ > Escape a string for use in AppleScript

## Install
```
$ npm install --save escape-string-applescript
$ npm install escape-string-applescript
```
## Usage
```js
const {execFile} = require('child_process');
const escapeString = require('escape-string-applescript');
import {execFile} from 'child_process';
import escapeStringAppleScript from 'escape-string-applescript';
const str = escapeString('"i like unicorns"');
const string = escapeStringAppleScript('"i like unicorns"');
//=> '\"i like unicorns\"'
const script = `set unicornMessage to "${str}"`;
const script = `set unicornMessage to "${string}"`;

@@ -30,10 +28,4 @@ execFile('osascript', ['-e', script]);

## Related
- [run-applescript](https://github.com/sindresorhus/run-applescript) - Run AppleScript and get the result
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc