
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@eavfw/expression-builder
Advanced tools
A powerful React component for building dynamic expressions with function suggestions and parameter hints.
A powerful React component for building dynamic expressions with function suggestions and parameter hints.

npm install @eavfw/expression-builder
import {
ExpressionProvider,
ExpressionInput,
FunctionPanel,
SingleLineInput
} from '@eavfw/expression-builder';
function App() {
return (
<div className="space-y-8">
{/* Multi-line expression input */}
<div className="bg-white rounded-lg shadow-lg p-6">
<h2 className="text-lg font-semibold mb-4">Multi-line Expression</h2>
<ExpressionProvider>
<ExpressionInput />
<FunctionPanel />
</ExpressionProvider>
</div>
{/* Single-line expression input */}
<div className="bg-white rounded-lg shadow-lg p-6">
<h2 className="text-lg font-semibold mb-4">Single-line Expression</h2>
<ExpressionProvider>
<SingleLineInput />
<FunctionPanel />
</ExpressionProvider>
</div>
</div>
);
}
For simpler use cases, you can use individual components with the context:
import { ExpressionProvider, ExpressionInput } from '@eavfw/expression-builder';
function SimpleExpression() {
return (
<ExpressionProvider>
<ExpressionInput />
</ExpressionProvider>
);
}
The Expression Builder uses React Context for state management. You can wrap your components with ExpressionProvider to access the shared state:
import { ExpressionProvider } from '@eavfw/expression-builder';
function App() {
return (
<ExpressionProvider>
<ExpressionInput />
<FunctionPanel />
</ExpressionProvider>
);
}
Access the expression context in your components using the useExpressionContext hook:
import { useExpressionContext } from '@eavfw/expression-builder';
function CustomInput() {
const { state, updateInput, selectFunction } = useExpressionContext();
return (
// Your component implementation
);
}
The expression context provides:
state: Current expression state including:
input: Current input valuecursorPosition: Current cursor positionisExpression: Whether currently typing a functionactiveFunction: Currently active functionparameterIndex: Current parameter being editedsuggestions: Available function suggestionsupdateInput(value: string, cursorPosition: number): Update input value
selectFunction(func: FunctionDefinition, cursorPosition: number): Select a function
dispatch: Direct access to the state reducer (advanced usage)
@ to see function suggestionsExample:
// Correct usage - @ only at the start of expression
@concat("Hello", upper("World"))
// Incorrect usage - don't use @ for nested functions
@concat("Hello", @upper("World")) // Wrong!
You can define your own functions by creating a function library:
import { FunctionDefinition } from '@eavfw/expression-builder';
const customFunctions: FunctionDefinition[] = [
{
name: 'greet',
description: 'Generates a greeting message',
parameters: [
{
name: 'name',
type: 'string',
description: 'Person to greet'
}
],
returnType: 'string',
examples: ['@greet("John") → "Hello, John!"'],
category: 'text'
}
];
Props:
state: ExpressionState - Current state of the expressiononInputChange: (value: string, cursorPosition: number) => void - Input change handleronFunctionSelect: (func: FunctionDefinition, cursorPosition: number) => void - Function selection handlerProps:
activeFunction: FunctionDefinition | null - Currently active functionparameterIndex: number - Index of the current parameter being editedReturns:
state: ExpressionState - Current expression stateupdateInput: (value: string, cursorPosition: number) => void - Update input handlerselectFunction: (func: FunctionDefinition, cursorPosition: number) => void - Function selection handlerWe welcome contributions! Please see our Contributing Guide for details.
MIT © EAVFW Contributors
FAQs
A powerful React component for building dynamic expressions with function suggestions and parameter hints.
We found that @eavfw/expression-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.