@exom-dev/no-clid

URL query filter for Express.js


Keywords
query-filter, fbclid, gclid, express, no-tracking
License
MIT
Install
npm install @exom-dev/no-clid@0.1.1

Documentation

About

NoClid is an URL query filter for Node.js / Express.

It was made to reject the useless and bloated clid query parameters, such as fbclid and gclid.

Getting started

Installation

You can install NoClid just like any other npm package.

npm i @exom-dev/no-clid --save

Note: this package includes a declaration file for TypeScript.

Usage

NoClid is an express middleware. Here's a basic example:

const app = require('express')();
const noclid = require('@exom-dev/no-clid');

app.use(noclid());

app.get('/', (request, response) => {
  response.send('Hello!');
});

app.listen(80);

If the URL contains clid parameters, NoClid will automatically redirect the user to the filtered URL, while keeping other request parameters the same.

Default

By default, NoClid will filter fbclid and gclid query parameters.

Changing the default

NoClid accepts an array of query parameters that should be filtered.

app.use(noclid(['q', 'lang', 'any-query-you-want']));

Releases

0.1.0 - July 13th, 2020

License License: MIT

This project was created by The Exom Developers.

The NoClid project is licensed under the MIT license.