Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucakiebel/appid
Find Steam games by their AppIDs or by their name. Convert one to the other.
https://github.com/lucakiebel/appid
Last synced: 9 days ago
JSON representation
Find Steam games by their AppIDs or by their name. Convert one to the other.
- Host: GitHub
- URL: https://github.com/lucakiebel/appid
- Owner: lucakiebel
- Created: 2018-08-06T10:59:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-29T19:47:54.000Z (over 2 years ago)
- Last Synced: 2024-10-28T07:03:27.923Z (18 days ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# appid
Use this package to easily convert Steam's AppIDs to their names and vice-versa!
## Examples
```js
await appid("Counter-Strike") // {appid:10,name:"Counter-Strike"}
await appid(730) // {appid: 730, name: "Counter-Strike: Global Offensive"}
await appid(/Grand Theft Auto/) // [{"appid":5152,"name":"Grand Theft Auto IV"},{"appid":5656,"name":"Grand Theft Auto - Episodes from Liberty City Trailer"} ...]
```**[LIVE DEMO!](https://replit.com/@lucakiebel/appid-test)**
### Convert Name to AppID
If you supply `appid` with a String, it will search the list of current games and return a Promise resolving the first game found.```js
let dota = await appid("Dota 2");
dota.appid // 570
```
If you want all games that have the supplied name, use [a Regular Expression](#by-regular-expression).### AppID to Name
```js
let mystery = await appid(4000);
mystery.name // "Garry's Mod"
```### By Regular Expression
Get all games starting with "a"```js
await appid(/^a/i) // [{"appid":630,"name":"Alien Swarm"},{"appid":635,"name":"Alien Swarm Dedicated Server"},{"appid":640,"name":"Alien Swarm - SDK"},...]
```## Installation
Install `appid` using `npm` or `yarn`
```bash
$ npm i --save appid$ yarn add appid
```
and require it in your project```js
const appid = require("appid");
```## Caught a Bug?
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link appid`. Instead of the default one from npm, Node.js will now use your clone of appid!