npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

unsplash-search

v1.0.2

Published

Unsplash search wrapper. (Typescript)

Downloads

48

Readme

Unsplash Search Wrapper (Typescript)

Coverage Status Build Status

Unsplash? Beautiful, free photos brought to you by the world’s most generous community of photographers. With this module, you can search on Unsplash, access the credits and download high-resoulution version. (even raw)

You can integrate it to the admin panel, use in web page, electron app or in node app.

Features

  • Search in
    • all Unsplash photos
    • only landscapes
    • only portraits
    • only squarish (Instagram ready)
  • Result includes
    • Author credits
    • Links (raw, download, full-size, thumbnail)
    • Related color
    • Dimension
    • Likes

Requirements

Getting Started

Installation:

npm install unsplash-search

Basic Usage

Create an instance with a valid API access key (see Requirements) A working demo on mnfy.me/unsplash-search (Made with React) Demo source code also avialable on https://github.com/arifaydogmus/unsplash-search-demo

import UnsplashSearch from 'unsplash-search';

const accessKey = '<your api access key>';
const provider = new UnsplashSearch(acessKey);

// Search 'berlin' and get 3rd page
provider
  .searchAll('berlin', 3)
  .then(data => {
    console.log('Total images in result:', data.totalImages);
    console.log('Total pages', data.totalPages);

    data.images.forEach(image => {
      console.log(
        `Taken by ${image.author.name} and download on ${image.urls.full}`
      );
    });
  })
  .catch(error => error);

alt text


API Methods

Following methods available names and paramters (if available) describe it self.

searchAll(query, page)

Searches in all available photos

searchLandscapes(query, page)

Searches only landscape oriented photos

searchPortraits(query, page)

Searches only portrait oriented photos

searchSquares(query, page)

Searches only square size photos

getQueryLimit()

Returns your API query limit

getRemaingQuery()

Returns your remaining API call

getItemsPerPage()

Returns active setting for how many images will be in result. Default is 10.

setItemsPerPage(limit)

Set setting for how many images will be in result Max is 30 according to Unsplash API.

Warnings

  • Unsplash official API has orient base search but the images in result may not be your selection.
  • Obviously the wrapper uses the Unsplash API so, respect to API query limitations.

License

ISC License - Arif Aydogmus