Twinski / ikea-availability-checker

ikea product in-store availability checker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sometimes there is a high demand for products that are unavailable in the IKEA online store and even in the locations. So here’s a script which makes it easy to check the availability of a list of products and locations.

MIT License NPM Package NPM Downloads CircleCI Known Vulnerabilities

Installation

Global

A globally installed ikea-availability-checker can be used anywhere but there can only be one version of it.

npm install -g ikea-availability-checker

After that the ikea-availability-checker should be callable from everywhere as there’s a link in your usr/bin directory:

ikea-availability-checker

Local

A locally installed ikea-availability-checker will be placed in ./node_modules/ikea-availability-checker and can be called using the binary link:

npm install ikea-availability-checker;
node_modules/.bin/ikea-availability-checker --help;

NPX

Or call it directly using npx:

npx ikea-availability-checker --help

Usage

Stores

npm run start -- stores at

┌─────────────┬─────────┬────────┬────────────────┐
│ countryCode │ country │ buCode │ name           │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 085    │ Wien Vösendorf │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 090    │ Wien Nord      │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 155    │ Klagenfurt     │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 273    │ Innsbruck      │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 386    │ Salzburg       │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 387    │ Graz           │
├─────────────┼─────────┼────────┼────────────────┤
│ at          │ Austria │ 388    │ Haid           │
└─────────────┴─────────┴────────┴────────────────┘

Product Stock Information

Product Stock Information for a whole country

npm run start -- stock --country at S69022537

┌──────────────────────────┬─────────────┬─────────┬───────────┬──────────────────┬────────────────┬───────┬─────────────┐
│ date                     │ countryCode │ country │ product   │ storeId (buCode) │ store          │ stock │ probability │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:16.036Z │ at          │ Austria │ S69022537 │ 387              │ Graz           │     8 │        HIGH │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:15.986Z │ at          │ Austria │ S69022537 │ 388              │ Haid           │    16 │        HIGH │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:16.081Z │ at          │ Austria │ S69022537 │ 273              │ Innsbruck      │    12 │        HIGH │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:15.988Z │ at          │ Austria │ S69022537 │ 155              │ Klagenfurt     │    13 │        HIGH │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:16.092Z │ at          │ Austria │ S69022537 │ 386              │ Salzburg       │    18 │        HIGH │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:16.092Z │ at          │ Austria │ S69022537 │ 090              │ Wien Nord      │    12 │        HIGH │
├──────────────────────────┼─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ 2020-02-14T10:02:16.095Z │ at          │ Austria │ S69022537 │ 085              │ Wien Vösendorf │    23 │        HIGH │
└──────────────────────────┴─────────────┴─────────┴───────────┴──────────────────┴────────────────┴───────┴─────────────┘

Product Stock Information for a specific store

with BU-Code (Store-Id)

npm run start -- stock --store=155 S69022537

┌─────────────┬─────────┬───────────┬──────────────────┬────────────┬───────┬─────────────┐
│ countryCode │ country │ product   │ storeId (buCode) │ store      │ stock │ probability │
├─────────────┼─────────┼───────────┼──────────────────┼────────────┼───────┼─────────────┤
│ at          │ Austria │ S69022537 │ 155              │ Klagenfurt │    10 │        HIGH │
└─────────────┴─────────┴───────────┴──────────────────┴────────────┴───────┴─────────────┘

Store-Name / Location / City-Name

The "store" option also accepts strings which match on the location’s name:

npm run start -- stock --store=Berlin 40413131

Multiple BU-Code(s)

npm run start -- stock --store=224,069,063 S69022537 40313075 40299687

┌─────────────┬─────────┬──────────┬──────────────────┬────────────────┬───────┬─────────────┐
│ countryCode │ country │ product  │ storeId (buCode) │ store          │ stock │ probability │
├─────────────┼─────────┼──────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ 40313075 │ 063              │ München-Eching │     9 │        HIGH │
├─────────────┼─────────┼──────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ 40313075 │ 069              │ Oldenburg      │     6 │        HIGH │
├─────────────┼─────────┼──────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ 40313075 │ 224              │ Sindelfingen   │    10 │        HIGH │
└─────────────┴─────────┴──────────┴──────────────────┴────────────────┴───────┴─────────────┘
┌─────────────┬─────────┬──────────┬──────────────────┬────────────────┬───────┬─────────────┐
│ countryCode │ country │ product  │ storeId (buCode) │ store          │ stock │ probability │
├─────────────┼─────────┼──────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ 40299687 │ 063              │ München-Eching │     9 │        HIGH │
├─────────────┼─────────┼──────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ 40299687 │ 069              │ Oldenburg      │    32 │        HIGH │
├─────────────┼─────────┼──────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ 40299687 │ 224              │ Sindelfingen   │    39 │        HIGH │
└─────────────┴─────────┴──────────┴──────────────────┴────────────────┴───────┴─────────────┘
┌─────────────┬─────────┬───────────┬──────────────────┬────────────────┬───────┬─────────────┐
│ countryCode │ country │ product   │ storeId (buCode) │ store          │ stock │ probability │
├─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ S69022537 │ 063              │ München-Eching │    19 │        HIGH │
├─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ S69022537 │ 069              │ Oldenburg      │     9 │        HIGH │
├─────────────┼─────────┼───────────┼──────────────────┼────────────────┼───────┼─────────────┤
│ de          │ Germany │ S69022537 │ 224              │ Sindelfingen   │     9 │        HIGH │
└─────────────┴─────────┴───────────┴──────────────────┴────────────────┴───────┴─────────────┘

The list of bu-codes can also contain bu-codes from different countries.

Other Projects & Articles

Development

Requirements

  • nodejs for version info check .nvmrc. it is strongly recommended to use either nvm and the exact same node version or the docker container as development environment

Debugging

DEBUG=ikea* npm run start

Testing

The project has a preconfigured test runner mocha. Test coverage is not good.

Run Tests

Running all tests will also create coverage reports shown after the test results.

npm run test

TDD

npm run tdd

Run Specific tests

run test -- --grep="stock reporter"

About

ikea product in-store availability checker

License:MIT License


Languages

Language:JavaScript 100.0%