Registry / data / featws-transpiler

featws-transpiler

JSON →
library0.7.4-rc1jsnpmunverified

A transpiler that converts FeatWS files (features.json, parameters.json, rules.featws) into GRL (Grule Rule Language) format for use with the Grule rule engine (https://github.com/hyperjumptech/grule-rule-engine). Current version is 0.7.4-rc1 (release candidate) with frequent releases. Supports special markers (# for features, $ for parameters, @ for groups), group definitions, JSON rules, and extended feature format. Key differentiator: designed specifically for Banco do Brasil's FeatWS ecosystem, not a general-purpose transpiler.

npm install featws-transpiler
INSTALL
IMPORT
SIG · FEATWS-TRANSPILER
F
featws-transpiler
datajavascriptv0.7.4-rc1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transpile
import { transpile } from 'featws-transpiler'
const transpile = require('featws-transpiler')
ESM module. The package does not export a default function; use named import.
FeaturesFile
import { FeaturesFile } from 'featws-transpiler'
import FeaturesFile from 'featws-transpiler'
Type is exported for TypeScript usage. Not a class for instantiation.
RulesFile
import { RulesFile } from 'featws-transpiler'
import { RuleFile } from 'featws-transpiler'
Correct name is RulesFile (plural). Common misspelling as RuleFile.

Demonstrates reading required input files and calling the transpile function to generate GRL output.

import { transpile } from 'featws-transpiler'; import { readFileSync } from 'fs'; const features = JSON.parse(readFileSync('features.json', 'utf8')); const parameters = JSON.parse(readFileSync('parameters.json', 'utf8')); const rules = readFileSync('rules.featws', 'utf8'); const result = transpile(features, parameters, rules); console.log(result.grlContent);
Debug
Known issues
breakingv0.7.0-rc1 changed parameters in transpile() call
fix
Refer to the changelog: resolve parameter renamed or reordered. Check the new signature in the source.
affects: >=0.7.0-rc1
gotchaDefault feature type is 'boolean' if not declared in features.json
fix
Always declare non-boolean features in features.json with explicit type.
affects: >=0.4.0
gotchaSpecial markers #, $, @ are mandatory in rules.featws
fix
Use # for features, $ for parameters, @ for groups. Otherwise transpiler may fail silently.
affects: >=0.3.0
deprecatedv0.5.0-rc1 renamed 'resolve' parameter to something else
fix
Update your code to use the new parameter name (e.g., 'resolver' or similar). Check release notes.
affects: >=0.5.0 <0.7.0
Errors
Common errors & fixes
Error: Cannot find module 'featws-transpiler'
Package not installed or ESM import not configured correctly.
fix
Run 'npm install featws-transpiler'. For ESM, ensure package.json has 'type': 'module'.
TypeError: features is not iterable
features parameter passed as object instead of array.
fix
Ensure features.json is an array of objects, not a single object. Use JSON.parse(file) correctly.
SyntaxError: Unexpected token '#' in rules.featws
The # marker is not being recognized; may be due to incorrect context or missing feature definition.
fix
Declare the feature in features.json. Use extended format if needed. Ensure # is not escaped.
Upgrade
Version history
0.7.4-rc1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
featws-transpiler — npm install featws-transpiler · libregistry