# @axway/api-builder-plugin-fn-javascript

> JavaScript plugin

Latest version **4.0.2** (published 2022-10-07) · SEE LICENCE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @axway/api-builder-plugin-fn-javascript
pnpm add @axway/api-builder-plugin-fn-javascript
yarn add @axway/api-builder-plugin-fn-javascript
bun add @axway/api-builder-plugin-fn-javascript
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.2 |
| Published | 2022-10-07 |
| First published | 2019-07-15 |
| Weekly downloads | 0 |
| License | SEE LICENCE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 16 |
| Dependencies | 1 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Axway |
| Maintainers | nkeranova, axway-npm, jamie.peabody, bladedancer, axway_darnaudov, ddimonov-axway, neon-axway, vchauhan, mdimitrova, pdzhorev, axway_alasdair, pltod2, pbozhkovaxway, mbonchev-axway, axway-vertex |
| Keywords | axway, amplify, api-builder, plugin, javascript |

## Links

- npm: https://www.npmjs.com/package/@axway/api-builder-plugin-fn-javascript
- Homepage: https://platform.axway.com
- Issues: https://axway.com
- npm.io page: https://npm.io/package/@axway/api-builder-plugin-fn-javascript

## Dependencies (1)

- [@axway/api-builder-sdk](https://npm.io/package/@axway/api-builder-sdk.md) 2.0.2

## Recent versions

- 4.0.2 (latest) — 2022-10-07
- 4.0.1 (christie) — 2022-09-23
- 4.0.0 (austen) — 2022-09-09
- 3.1.5 (villasimius) — 2022-09-07
- 3.1.4 (next) — 2022-07-26
- 3.1.3 (riga) — 2022-07-13
- 3.1.2 (qom) — 2022-06-20
- 3.1.1 — 2022-05-17
- 3.1.0 — 2022-04-06
- 3.0.3 — 2021-10-08
- 3.0.2 — 2021-08-25
- 3.0.1 — 2021-08-10
- 3.0.0 — 2021-06-30
- 2.1.1 — 2021-05-20
- 2.1.0 — 2021-05-18
- … 18 more at https://npm.io/package/@axway/api-builder-plugin-fn-javascript/versions

## README

# @axway/api-builder-plugin-fn-javascript

## About

This plugin installs the JavaScript flow-node to be used within [Axway API Builder's](https://www.axway.com/en/datasheet/axway-api-builder)
flow editor.

## Usage

Check our docs on [How to use the JavaScript plugin](https://docs.axway.com/bundle/api-builder/page/docs/developer_guide/flows/flow_nodes/javascript_flow_node/index.html).

## Methods

### Execute

Allows the execution of JavaScript code and returns the result of the execution as the flow-node's output.
⚠️ **Warning**: You should never use this flow-node to execute code coming from untrusted sources.

| Param | Type | Description | Configuration selection | Required |
| --- | --- | --- | --- | --- |
| code | string | A JavaScript function body. Supports `await` and returning promises. | Selector, String | Yes |
| data | any | The value to apply as the `data` argument to the JavaScript code. For objects and arrays, `data` is passed by reference. | Any | No |

## Install

After creating your API Builder service (`api-builder init`), you can install this plugin using npm:

```
npm install --no-optional @axway/api-builder-plugin-fn-javascript
```

The "JavaScript" flow-node will then be available in the tools panel when creating or editing Flows.

## Changes

#### 4.0.2
- #7538: Update `@axway/api-builder-sdk` dependency.

#### 4.0.1
- #7517: Update @axway/api-builder-sdk dependency.

#### 4.0.0
- #6089: Breaking change: requires minimum Node.js version 16.x.

#### 3.1.5
- #7470: Update @axway/api-builder-sdk dependency.

#### 3.1.4
- #7466: Update @axway/api-builder-sdk dependency.

#### 3.1.3
- #7474: Internal dev-dependency move.

#### 3.1.2
- #7412: Pin in-house dependencies.

#### 3.1.1
- #7403: Internal dev-dependency change.

#### 3.1.0
- #6933: Replace peerDependency on @axway/api-builder-runtime with `engines.apibuilder`.

#### 3.0.3
- #7057: Updated documentation links.

#### 3.0.2
- #7010: Changed the JSON schema of Next output from `type: string` to any `schema: {}`.
- #7010: Internal refactor of unit-tests.

#### 3.0.1
- #7004: Ensured `Code` with trailing comment(s) executes with no issue.

#### 3.0.0
- #6814: Breaking change: Removed 'Advanced' parameter, `Unsafe mode` from the flow-node. Now all Node.js globals are available by default and code will be executed in the same context as the rest of the API Builder service.

#### 2.1.1
- #6815: Internal tooling changes.

#### 2.1.0
- #6867: Made the API Builder `logger` available to use within `code` alongside `data`.

#### 2.0.0
- #6453: Breaking change: Changed errors to throw `any` valid type.
- #6453: Capitalized parameter names, `Code` and `Data` in flow-node yml.

#### 1.2.7
- #6445: Fixes incorrectly displayed function signature in JavaScript editor.

#### 1.2.6
- #6414: Migrate from axway-flow-sdk to @axway/api-builder-sdk@1.0.0.

#### 1.2.5
- #6315: Internal chore.

#### 1.2.4
- #6233: Fix issue where errors were resolved as an object instead of resolving with an actual `Error`.

#### 1.2.3
- #6222: Improve security testing for unsafe mode.
- #6222: Remove unexpected `constructor` property mutating `data` and global `console` during unsafe mode.
- #6222: Remove access to external Object constructor on `data` during code execution while ensuring it remains a non-enumerable property during unsafe mode.

#### 1.2.2
- #6153: Updated documentation.

#### 1.2.1
- #6116: Bump `axway-flow-sdk` dependency

#### 1.2.0
- #6093: Removed the explicit maximum supported Node.js version limitation in package.json.
- #6093: Internal test suite clean up.

#### 1.1.4
- #6118: Fix `README.md` installation instructions.

#### 1.1.3
- #6026: Document ranges of supported Node.js versions in package.json.

#### 1.1.2
- #6074: Internal CI chore.

#### 1.1.1
- #5924: Bump `axway-flow-sdk` dependency.

#### 1.1.0
- #5829: Update `code` and `Unsafe Mode` parameters to use `initialType` string and boolean respectively to simplify the Flow-Node UX.

#### 1.0.0
- #5891: Update `code` parameter to use the `javascript` format and display a function wrapper using `multilineWrapper` to give context in the UI.

#### 0.1.1
- #5876: Prerelease, initial implementation.

## License

This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: [https://support.axway.com/en/auth/general-conditions](https://support.axway.com/en/auth/general-conditions); EXCEPT THAT IF YOU RECEIVED A FREE SUBSCRIPTION, LICENSE, OR SUPPORT SUBSCRIPTION FOR THIS CODE, NOTWITHSTANDING THE LANGUAGE OF THE GENERAL CONDITIONS, AXWAY HEREBY DISCLAIMS ALL SUPPORT AND MAINTENANCE OBLIGATIONS, AS WELL AS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED INFRINGEMENT WARRANTIES, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND YOU ACCEPT THE PRODUCT AS-IS AND WITH ALL FAULTS, SOLELY AT YOUR OWN RISK. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.

---
_Source: https://npm.io/package/@axway/api-builder-plugin-fn-javascript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
