New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

alfresco-javascript-console

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alfresco-javascript-console

write and run JavaScript scripts against an Alfresco repository directly from the IDE

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

Alfresco JavaScript Console

Run JavaScript scripts against an Alfresco repository from VS Code or the command line.

Supports both OOTBee JavaScript Console (actively maintained) and the original fme AG JavaScript Console, with automatic variant detection.

Installation

VS Code Extension

Install from the VS Code Marketplace, or search for "Alfresco Javascript Console" in VS Code extensions.

CLI

npm install -g alfresco-javascript-console

VS Code Extension

Quick Start

  • Install the extension
  • Configure your server: Ctrl+Shift+P → "Configure Alfresco Server"
  • Open a JavaScript file and press Ctrl+Shift+R to execute

Features

  • Script Execution — Run scripts directly against Alfresco with real-time streaming output
  • Multi-Profile — Manage multiple Alfresco server connections and switch between them
  • Parameter Control — Configure transaction type, run-as user, space/document context, and FreeMarker templates
  • Code Snippets — Built-in Alfresco API snippets (type alf- for suggestions)
  • Secure Storage — Credentials stored in VS Code's secret storage

Commands

CommandShortcutDescription
Run ScriptCtrl+Shift+RExecute current script against Alfresco
Configure ServerSet up server connection
Open Console PanelShow execution parameter panel
Add Server ProfileAdd a new server profile
Switch Server ProfileSwitch active profile
Edit Server ProfileEdit an existing profile
Delete Server ProfileRemove a profile

Settings

SettingDescription
alfrescoJsConsole.server.urlAlfresco server URL
alfrescoJsConsole.server.consoleVariantConsole variant: auto, ootbee, or fme
alfrescoJsConsole.server.usernameUsername for authentication
alfrescoJsConsole.execution.defaultTransactionDefault transaction type (readonly / readwrite)
alfrescoJsConsole.execution.defaultRunAsDefault run-as user

Code Snippets

Type any prefix and press Tab:

alf-search · alf-props · alf-create · alf-people · alf-home · alf-workflow · alf-perms · alf-aspects · alf-children

CLI

Zero-dependency command-line tool for running Alfresco scripts from the terminal or CI pipelines.

Usage

# Run a script file
alfresco-js-console run script.js --server https://localhost:8080/alfresco --username admin --password admin

# Read from stdin
cat script.js | alfresco-js-console run -

# Use a saved profile
alfresco-js-console run script.js

# With FreeMarker template
alfresco-js-console run script.js --template output.ftl

# JSON output (for scripting/AI tooling)
alfresco-js-console run script.js --json

Profile Management

# Add a profile
alfresco-js-console profile add

# List profiles
alfresco-js-console profile list

# Switch active profile
alfresco-js-console profile switch <name>

# Delete a profile
alfresco-js-console profile delete <name>

Profiles are stored in ~/.alfresco-js-console/config.json with 0600 permissions.

FreeMarker Templates

Pass a FreeMarker template file with --template to format script output. Populate the template model by setting properties on the model object in your script:

script.js:

var children = companyhome.children;
model.nodes = children;
model.user = person.properties["cm:userName"];

output.ftl:

User: ${user}

<#list nodes as node>
  ${node.name} (${node.typeShort}) - ${node.nodeRef}
</#list>
alfresco-js-console run script.js --template output.ftl

Exit Codes

CodeMeaning
0Success
1Script execution error
2Configuration or usage error

Sample Script

// print() streams output in real-time
print("Hello from Alfresco!");
print("Company Home: " + companyhome.name);
print("Current User: " + person.properties["cm:userName"]);

var children = companyhome.children;
print("Company Home has " + children.length + " children:");
for (var i = 0; i < Math.min(children.length, 5); i++) {
    print("  - " + children[i].name);
}

// model.* populates FreeMarker template variables
model.nodes = children;
model.user = person.properties["cm:userName"];

Requirements

  • Access to an Alfresco server with JavaScript Console webscript installed
  • Valid Alfresco user credentials
  • VS Code extension: VS Code 1.99.0+
  • CLI: Node.js 20+

License

MIT

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts