Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@croct/rule-engine-audiences

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@croct/rule-engine-audiences

A rule engine extension for audience targeting.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
3
Created
Source

Croct
Audiences Extension
A Rule Engine extension for audience targeting.

Version Build Maintainability Coverage

📦Releases · 🐞Report Bug · ✨Request Feature

Installation

The recommended way to install this plugin is using NPM. It pairs nicely with module bundlers such as Rollup, Webpack or Browserify and includes Typescript typings.

Run the following command to install the latest version:

npm install @croct/rule-engine-audiences

Basic usage

import croct from '@croct/plug';
import '@croct/rule-engine';
import '@croct/rule-engine-audiences';

croct.plug({
    plugins: {
        rules: {
            extensions: {
                audiences: {
                    map: {
                        'returning-users': 'user is returning',
                    },
                    defaultOptions: {
                        timeout: 300,
                    },
                },
            },
            pages: {
                '/home': [
                    {
                        rules: [
                            {
                                name: 'welcome-returning-users',
                                properties: {
                                    audience: 'returning-users',
                                }
                            }
                        ]
                    }
                ]
            }
        },
    },
});

Contributing

Contributions to the package are always welcome!

  • Report any bugs or issues on the issue tracker.
  • For major changes, please open an issue first to discuss what you would like to change.
  • Please make sure to update tests as appropriate.

Testing

Before running the test suites, the development dependencies must be installed:

npm install

Then, to run all tests:

npm run test

Run the following command to check the code against the style guide:

npm run lint

Building

Before building the project, the dependencies must be installed:

npm install

Then, to build the CommonJS module:

npm run build

This project is released under the MIT License.

Keywords

croct

FAQs

Package last updated on 23 Jul 2020

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