Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Latest commit

 

History

History
59 lines (35 loc) · 1.56 KB

README.md

File metadata and controls

59 lines (35 loc) · 1.56 KB

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.1 - July 20th, 2020

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.