# lime-survey-exp-manager

> The lime survey Expression Manager is a js module that provides functionality for parsing and highlighting expressions in a text area. It can be used to provide suggestions to users while they are typing identifiers, function names, and suffixes in an exp

Latest version **1.0.11** (published 2026-09-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install lime-survey-exp-manager
pnpm add lime-survey-exp-manager
yarn add lime-survey-exp-manager
bun add lime-survey-exp-manager
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2026-09-23 |
| First published | 2023-07-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 379.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | balavinayagapragathish.sathish, balavinayagapragathish.s, sriharshini.kothakapu, zoomrx_admin |

## Links

- npm: https://www.npmjs.com/package/lime-survey-exp-manager
- Repository: https://github.com/ZoomRx/lime-survey-exp-manager
- Homepage: https://github.com/ZoomRx/lime-survey-exp-manager#readme
- Issues: https://github.com/ZoomRx/lime-survey-exp-manager/issues
- npm.io page: https://npm.io/package/lime-survey-exp-manager

## Recent versions

- 1.0.11 (latest) — 2026-09-23
- 1.0.10 — 2026-03-06
- 1.0.9 — 2026-02-05
- 1.0.8 — 2026-02-05
- 1.0.7 — 2025-02-14
- 1.0.6 — 2025-02-06
- 1.0.5 — 2023-09-12
- 1.0.4 — 2023-08-24
- 1.0.3 — 2023-07-31
- 1.0.2 — 2023-07-31
- 1.0.1 — 2023-07-31

## README

# Lime Survey Expression Manager Node Module
The lime survey Expression Manager is a js module that provides functionality for parsing and highlighting expressions in a text area. It can be used to provide suggestions to users while they are typing identifiers, function names, and suffixes in an expression.

## Installation
  To use the Expression Manager in your project, you need to install it using npm. Open your terminal or command prompt and run the following command:
```bash
  npm install lime-survey-exp-manager
```

## Usage
  To use the Expression Manager, you need to import the createExpressionManager function from the module. It takes an object as an argument with the following properties:

  **placeholder (optional):** The placeholder text to be displayed in the text editor when it is empty.  
  **readOnly (optional):** A boolean value to specify if the text editor should be read-only or editable. Default value is false.  
  **identifiers (optional):** Object containing all the different identifiers that can be written in the expression  
    &emsp;**Format:** { name: { description: "Description text" } }  
    &emsp;**options:**
        &emsp;&emsp;1. description (String) - Description to shown for the identifier in suggestion  
        &emsp;&emsp;2. suggestionOnly (Bool) - The identifier will only be used for showing suggestions (if true)  
        &emsp;&emsp;3. displayFor (String) - Match string for which the identifier can be shown in the suggestion  
        &emsp;&emsp;4. hideFor (String) - Match string for which the identifier should not be shown in the suggestion  
        &emsp;&emsp;5. returnType (*) - Type of the value the variable can have during runtime  
        &emsp;&emsp;6. customHTML (String) - Custom text to be shown instead of the name   
  **expFunctions (optional):** Functions to be supported inside the autocomplete field  
  **identifiersPattern:** Match pattern for validating identifers  
         &emsp;&emsp; 'TOKEN|USER_ATTR|USER'
  **textBox:** The text area or text editor element that you want to attach the Expression Manager to.  
  **suffixes (optional):** These will be displayed in the suggestion when the user types a "."
      Anything that the user types after the "." will be considered a suffix and the corresponding list 
      will alone be searched.  
#### Listeners
  The suggestionListener emits three parameters:  
  **helpFor:** This refers to the element for which suggestions need to be shown.  
  **currentSuggestions:** It represents a list of suggestions (identifiers, suffixes, and expFunctions) that are matched for the element specified by the helpFor.  
  **activeSuggestionIndex:** It represents the index of the currently active suggestion in the currentSuggestions list.

Here is an example of how to use the Expression Manager:
```javascript
  import { createExpressionManager, expFunctions } from 'survey-exp-manager';

  // Get the text area element
  const textBoxElement = document.getElementById('myTextArea');

  // Define identifiers, expression functions, and suffixes (optional)
  const identifiers = { 
      // ... 
  };
  const expFunctions = expFunctions;
  const suffixes = {
      // ...
  };

  // Create the Expression Manager
  const expressionManager = createExpressionManager({
      placeholder: 'Type your expression here...',
      readOnly: false,
      identifiers,
      expFunctions,
      textBox: textBoxElement,
      suffixes,
  });

  // Listen for events (optional)
  expressionManager.on('onFocus', (expression) => {
      // Handle focus event
  });

  expressionManager.on('onBlur', (expression) => {
      // Handle blur event
  });

  expressionManager.on('suggestionsListener', ({ currentSuggestions, helpFor, activeSuggestionIndex }) => {
      // Handle suggestion changes
  });

  expressionManager.on('updateSuggestionIndex', (activeIndex) => {
        // Handle suggestion index
  });
  // You can also update identifiers or read-only mode dynamically
  expressionManager.updateIndentifier(identifiers);
  expressionManager.updateReadOnly(true);

  // To remove the change listener
  expressionManager.removeChangeListener();
  ```
## Dependencies
  The Expression Manager has the following dependencies, which will be automatically installed when you install the module:

  **events**: Node's event emitter for all engines.

  **acorn-loose**: This parser will parse any text into an ESTree syntax tree that is a reasonable approximation of what it might mean as a JavaScript program.

  **acorn-walk**: An abstract syntax tree walker for the ESTree format.

## License
  This project is licensed under the MIT License - see the LICENSE file for details.

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