1.0.1 • Published 2 years ago

@arifszn/wallpaper-js v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Description

wallpaper.js is a JavaScript package to get bulk wallpapers. Supports both browser and server.

You may be interested in also:

Installation

Install via NPM.

npm install @arifszn/wallpaper-js

Or install via Yarn.

yarn add @arifszn/wallpaper-js

You can also try it online.

Usage

Import

const { getWallpaper } = require('@arifszn/wallpaper-js');

Or

import { getWallpaper } from '@arifszn/wallpaper-js';

Get 1 wallpaper

getWallpaper().then((result) => {
  console.log(result);
});

Get 20 wallpapers

getWallpaper({
  total: 20,
}).then((result) => {
  console.log(result);
});

Options

PropertyTypeDescriptionDefault
totalnumberHow many wallpapers to get. Max is 201
allowNSFWbooleanAllow NSFW content in resultstrue

Sample Response

[
  {
    id: 'abcxyz',
    title: 'Wallpaper title',
    postLink: 'https://redd.it/abcxyz',
    image: 'https://i.redd.it/example.jpg',
    thumbnail: 'https://a.thumbs.redditmedia.com/example.jpg',
    subreddit: 'example',
    NSFW: false,
    spoiler: false,
    createdUtc: 1644549590,
    upVotes: 464,
    upVoteRatio: 1.0,
  },
];

Contribute

To contribute, see the Contributing guide.

Support

License

wallpaper.js is licensed under the MIT License.