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

imboclient-metadata

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imboclient-metadata

An Imbo client metadata extension

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

npm versionBuild StatusDependency status

Metadata search client addon

An addon for the Imbo javascript client.

Installation

imboclient-js-metadata can be installed using npm:

npm install imboclient-metadata

Basic usage

There is no clearly defined add-on or plugin concept in the imboclient, but this add-on is written in a way that requires you to add the functions it exports to the Imbo.Client prototype for it to work. Exactly how you want to do this is up to you.

'use strict';

var Imbo = require('imboclient');
var metadata = require('imboclient-metadata');

// Add method to prototype
Imbo.Client.prototype.searchMetadata = metadata.searchMetadata;
Imbo.Client.prototype.searchGlobalMetadata = metadata.searchGlobalMetadata;

// Instantiate client
var client = new Imbo.Client('http://imbo', 'foobar', 'barfoo');

// Search for cat images using metadata across user and other-user
client.searchGlobalMetadata(
    // The metadata query to perform
    { animal: 'cat' },

    // Options
    {
        users: ['user', 'other-user'],

        // Whether to include metadata for images in response or not
        metadata: 1,

        // Which fields to return
        fields: ['width', 'height', 'imageIdentifer'],

        // Sort order of result set. Default is ordering from metadata backend
        sort: ['width:asc', 'height:desc']
    },

    function(err, body, meta, res) {
        console.log(err, body, meta);
    }
);

// Search for cat images using metadata across user and other-user
client.searchMetadata(
    // The user to search for images from
    'user',

    // The metadata query to perform
    { animal: 'cat' },

    // Options are the same as with searchGlobalMetadata, minus the users option
    {},

    function(err, body, meta, res) {
        console.log(err, body, meta);
    }
);

License

Copyright (c) 2015, Kristoffer Brabrand kristoffer@brabrand.no

Licensed under the MIT License

Keywords

FAQs

Package last updated on 13 Oct 2015

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