New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

object-to-query

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-to-query

an small library to convert js objects to querystrings

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

object-to-query Build Status

an small library to convert js objects to querystrings

Usage

  • Install with npm

      npm install object-to-query --save
    
  • Start using is as simple as:

    
    const transform = require('object-to-query')
    
    const result = transform({ id: 1, name: 'Eduardo' });
    
    console.log(result);
    
    // output &id=1&name=Eduardo
    
    
  • You can exclude the properties you want

    
    const transform = require('object-to-query')
    
    const result = transform({ id: 1, name: 'Eduardo', notThisOne: 'i am a bad property', age: 30 }, ['notThisOne']);
    
    console.log(result);
    
    // output &id=1&name=Eduardo&age=30
    
    
  • I want the question mark as the first symbol in my string!!11UNO

    
    const transform = require('object-to-query')
    
    const result = transform({ id: 1, name: 'Eduardo' }, [], true);
    
    console.log(result);
    
    // output ?id=1&name=Eduardo
    
    

Development

  1. Install dependencies

     npm install
    
  2. Write your code! Yep that's it!

Testing

  1. We are using tape because is small and awesome, only run the default test command

     npm test
    
  2. If everything looks green you are fine.

Code Coverage

  1. Istanbul

Keywords

FAQs

Package last updated on 19 Jul 2017

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