Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-qs-manager

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-qs-manager

A query string manager for express

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

express-qs-manager

A query string manager for express

What does it do

It allows you to easily manipulate query strings within templates

Usage

check the examples folder for usage scenarios

Initialize like so :

var Qs = require('express-qs-manager');
app.use(Qs.init());

then somewhere in your routes assign to a variable the query string from express and pass it to the templates

res.render('myTemplate.html',{QueryString : req.query});

After that you're good to go. In any template just use the Qs.appends or Qs.exclude methods to either add or remove parameters from the query string. You can also use the Qs.has method to check if a key-value set is in the query string

<a href="?{{ Qs.appends(QueryString,{myKey:'myValue'}) }}"
                       class="{% if Qs.has(QueryString,'myKey','myValue') %} active{%endif%}">
                        A link</a>

Keywords

FAQs

Package last updated on 01 Mar 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc