Skip to content

Commit

Permalink
added the core readme and some package stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
matt123miller committed Oct 19, 2020
1 parent 5a01dfa commit e862e97
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 887 deletions.
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "caniuse-bot-cli",
"name": "caniuse-cli",
"version": "0.0.1",
"author": "matt123miller",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchForFunctionality } from 'caniuse-bot-core';
import { searchForFunctionality } from 'caniuse-bot';

export function cli () {
const feature = 'grid';
Expand Down
52 changes: 51 additions & 1 deletion core/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
# caniuse-bot-core
# CANIUSE-BOT

This is a simple wrapper around caniuse-api to simplify me making a few other projects.

All the data return should match what's used on [www.caniuse.com](https://canius.com).

## Installation

`npm install --save caniuse-bot`

## Usage

The main usage of this package is the `searchForFunctionality` function.
Provided with a string it will try and find and format the corresponding date from caniuse.

```TypeScript
import { searchForFunctionality } from 'caniuse-bot';

const results = searchForFunctionality('css-grid');

console.log(results);
/**
* {
* fullSupport: { firefox: 52, chrome: 57, edge: 16, safari: 10.1 },
* partialSupport: { firefox: 51, chrome: 56, ie: 9, safari: 10 },
* noSupport: { firefox: 18, chrome: 24, ie: 8, safari: 5.1 }
* }
*/
```

However if you provide an argument that could give an ambiguous answer then it returns an array of strings containing each option.
It's up to the consumer to decide how to handle this.

```TypeScript
import { searchForFunctionality } from 'caniuse-bot';

const results = searchForFunctionality('grid');

console.log(results);
/**
* [ 'css-grid', 'css-subgrid' ]
*/
```

## Contributing

Contributions welcome! Though at this point I don't know what there is to add.

## License

This project is MIT licensed.
Loading

0 comments on commit e862e97

Please sign in to comment.