Welcome to seed-picture-warcraft package
This is a package who returns an url based on your IDs for seed pictures. All rights are reserved for Blizzard because of pictures used from the game Warcraft III : Reforged !
It's working with node.js language and Typescript.
⚠️ Never use this kind of medias with this package on your projects in production mode. It's only for seeds (fake data) in development / early projects to see some media data easily in your front-end.
🚀 Get started
Installation
$ npm install seed-picture-warcraft
// or
$ yarn add seed-picture-warcraft
Example
import { getPictureUrl } from 'seed-picture-warcraft';
console.log(getPictureUrl(
getPictureUrl({
id: '7e9d1d12-8c95-4a06-8368-f5394915bb46',
type: 'gem',
})
);
👾 Usage
- Config
- id: Must be a string (with uuid format) or an integer.
- type:
male
, female
, animal
, effect
, gem
, orb
, item
, book
, document
, consumable
, weapon
, staff
, armor
, shield
, mob
, structure
.
Example n°1: Get an image from the seed with an uuid (string).
import { getPictureUrl } from 'seed-picture-warcraft';
getPictureUrl({
id: '7e9d1d12-8c95-4a06-8368-f5394915bb46',
type: 'orb',
});
Example n°2: Get an image from the seed with an id (integer).
import { getPictureUrl } from 'seed-picture-warcraft';
getPictureUrl({
id: 2940,
type: 'document',
});
Example n°3: Best practices
⚠️ Set the values from the enums represents a better practice than the "magic variables".
import { getPictureUrl, SPW_EnumMediaType } from 'seed-picture-warcraft';
getPictureUrl({
id: '00790dc9-7bfa-4c20-8b87-c5530c624655',
type: SPW_EnumMediaType.item,
});
🚦 Tests
To test all the app with jest (100% coverage), you need to run this command line:
$ yarn test
License
This package is MIT licensed and Blizzard Licenced too.