# scpl

> `npm install --save scpl` or `yarn add scpl`

Latest version **1.14.1** (published 2021-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install scpl
pnpm add scpl
yarn add scpl
bun add scpl
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.14.1 |
| Published | 2021-07-25 |
| First published | 2019-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | pfg |
| Maintainers | pfg |

## Links

- npm: https://www.npmjs.com/package/scpl
- Repository: https://github.com/pfgithub/shortcutslang
- Homepage: https://pfgithub.github.io/shortcutslang
- Issues: https://github.com/pfgithub/shortcutslang
- npm.io page: https://npm.io/package/scpl

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [plist](https://npm.io/package/plist.md) ^3.0.1
- [bplist-parser](https://npm.io/package/bplist-parser.md) ^0.1.1
- [bplist-creator](https://npm.io/package/bplist-creator.md) ^0.0.7

## Recent versions

- 1.14.1 (latest) — 2021-07-25
- 1.14.0 — 2019-09-08
- 1.13.10 — 2019-08-12
- 1.13.9 — 2019-07-12
- 1.13.8 — 2019-07-02
- 1.13.7 — 2019-07-02
- 1.13.6 — 2019-06-22
- 1.13.5 — 2019-06-19
- 1.13.4 — 2019-06-13
- 1.13.3 — 2019-06-06
- 1.13.2 — 2019-06-03
- 1.13.1 — 2019-05-30
- 1.13.0 — 2019-05-27
- 1.12.1 — 2019-05-25
- 1.12.0 — 2019-05-25
- … 29 more at https://npm.io/package/scpl/versions

## README

Note that ScPL has not been updated to support the new iOS 13/14+ actions. If you are looking for a text shortcuts language, consider Jellycuts. 

<p align="center">
  <a href="" rel="noopener">
 <img height=200px src="https://i.imgur.com/vIVZPVg.png" alt="Project logo"></a>
</p>

<h3 align="center">ScPL</h3>

<div align="center">

[![Build Status](https://travis-ci.org/pfgithub/scpl.png)](https://travis-ci.org/pfgithub/scpl) [![codecov](https://codecov.io/gh/pfgithub/scpl/branch/master/graph/badge.svg)](https://codecov.io/gh/pfgithub/scpl) [![discord](https://img.shields.io/discord/581979006463639565.svg?logo=discord&color=blue)](https://discord.gg/2qqfFKc)

</div>

---

<p align="center"> ScPL is a programming language for writing iOS Shortcuts in text.
    <br> 
</p>

<p>
    ScPL is a programming language for Shortcuts that allows you
    to write shortcuts in text instead of dragging and dropping
    blocks. ScPL lets you work with large shortcuts easily by
    letting you copy and paste actions, view long shortcuts without
    scrolling, and type actions instead of dragging them in.
    <a href="https://docs.scpl.dev/gettingstarted">Get Started</a>
</p>

<pre><code class="scpleditor language-scpleditor">ShowResult "Hello ScPL"
ChooseFromMenu prompt="ScPL" items=["Getting Started", "View Documentation"]
Case "Getting Started"
    URL "https://docs.scpl.dev/gettingstarted"
Case "View Documentation"
    URL "https://docs.scpl.dev/"
End Menu
OpenURLs</code></pre>

<p>See what your shortcut looks like in ScPL by uploading it in the <a href="https://editor.scpl.dev/">ScPL Editor</a>.</p>

<h1 id="whatisscpl">What is ScPL</h1>

<p>
    ScPL lets you write shortcuts in text. Instead of dragging actions
    around on a small screen in a slow app, you can write text like
    <code>ShowResult "My shortcut"</code> to build long and complex
    shortcuts.
</p>

<h1 id="editors">Editors</h1>

<h2 id="webeditor">Web Editor</h2>

<p>
    The ScPL Web Editor (<a href="https://editor.scpl.dev">editor.scpl.dev</a>)
    is the easiest way to write ScPL.
</p>

<h2 id="visualstudiocode">Visual Studio Code</h2>

<p>
    ScPL has a plugin for Visual Studio Code with autocompletion, error messages,
    and hover documentation.
    <a href="https://marketplace.visualstudio.com/items?itemname=pfg.vscode-shortcutslang-extension">VSCode Extension</a>.
</p>

<p>
    To compile your ScPL code you can use the scpl-cli npm package.
    <code>npm install --global scpl-cli</code>. Then you can run
    <code>scpl &lt;filename.scpl&gt; -o &lt;outputfile.shortcut&gt;</code>
</p>

## Usage (in other Javascript projects) <a name="usage"></a>

`npm install --save scpl` or `yarn add scpl`

```typescript
const {parse, inverse} = require("scpl");
 
const {shortcutjson, shortcutplist} = parse("text 'hello scpl'", {make: ["shortcutjson", "shortcutplist"]});
// shortcutjson is a json object containing the shortcut file.
// shortcutplist is a buffer containing the shortcut file bplist.
 
const inverted = inverse(shortcutplist);
// text "hello scpl"
```

## Contributing <a name="contributing"></a>

### Prerequisites
ScPL uses yarn for package management. [Install Yarn](https://yarnpkg.com/en/docs/install#debian-stable)

### Installing

```
git clone https://github.com/pfgithub/scpl.git
cd scpl
yarn install
```

The ScPL repository does not have any tools for converting ScPL code to .shortcut files. That can be found in the [scpl-editor](https://github.com/pfgithub/scpl-editor) or the [scpl-cli](https://github.com/pfgithub/scpl-cli) projects.

### Running tests <a name="tests"></a>

```
yarn test
```

ScPL tests using Jest and automatically generates coverage reports. You can use the coverage report lcov file in `coverage/lcov.info` to set your editor to show test coverage.

### Before making a pull request

```
yarn prepublishOnly
```

prepublishOnly will automatically format your code using prettier and make sure tests pass.

## Acknowledgements <a name="acknowledgement"></a>
- [xAlien95](https://github.com/xalien95/) for finding the actions plist file within the shortcuts ipa and manually making lists of all the variable types and aggrandizements.
- [Shortcuts JS](https://github.com/joshfarrant/shortcuts-js) for the complete shortcut glyph and color list.

---
_Source: https://npm.io/package/scpl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
