sgentle / caniuse-cmd Goto Github PK
View Code? Open in Web Editor NEWCaniuse command line tool
License: MIT License
Caniuse command line tool
License: MIT License
I'm not familiar with the underlying mechanics of CIU but was wondering if was possible to run a private package through it?
Eg. I would like to show browser share for a specific country instead of the global data.
The command "caniuse elementsFromPoint" return "elementsfrompoint: not found"
It would be great to have a ~/.caniuse
file to specify my default options. For example, I'm generally interested in --era e2
.
It would be useful to see suggested technologies and their popularity in addition to the technologies that are already being tracked by Caniuse. The information about suggested technologies is available from http://caniuse.com/issue-list
Is it possible to search for multiple features?
e.g. Is it possible to node .\bin.js async-functions,object-values
If I see that Chrome 24 partially supports for a feature, I might think that's relevant unless I see that the latest version of Chrome is 47 ๐
Maybe something like this:
Chrome โ 4+ โ 8+ยน โ 23+ยฒ โ 24+ โฆ 47
This project uses a fork of yargs with a config-booleans
branch.
Line 32 in fa1b418
It looks like the new yargs-parser has changes related to default booleans, and this fork may no longer be required.
Snippet of some of the changes:
Object.keys(flags.configs).forEach(function (configKey) {
...
// setting arguments via CLI takes precedence over
// values within the config file.
if (argv[key] === undefined || (flags.defaulted[key])) {
delete argv[key]
setArg(key, config[key])
}
})
} catch (ex) {
if (argv[configKey]) error = Error(__('invalid json config file: %s', configPath))
}
}
})
}
Snippet of some of current yargs-parser code:
Object.keys(config).forEach(function (key) {
...
// setting arguments via CLI takes precedence over
// values within the config file.
if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
setArg(fullKey, value)
}
}
})
}
Era is great, but I'd love to be able to only display browsers and usage percentage for only those browser above 1% or some other configurable threshold.
Just a feature idea : )
Apparently, this package depends on an insecure version of the package open.
GHSA-28xh-wpgr-7fm8
Sorry but I have to ask about that. As you know, nowadays CoffeeScript is pretty outdated. Want to help out, create pull requests but those CoffeeScript lines makes me really sick (there is no reason to learn that in 2017) and I am quite really sure there are plenty amount of people who don't want to write CoffeeScript. So, converting the project vanilla JavaScript will increase potential contributors.
If there are no browsers that fully support a feature and at least one browser that partially supports the feature, that partial support percentage is not shown.
Compare the actual output:
# only full, no partial
$ caniuse --oneline hidden
hidden attribute โ 92.16% โ 0% [WHATWG Living Standard]
# full and partial
$ caniuse --oneline spellcheck
Spellcheck attribute โ 54.57% โ 39.3% [WHATWG Living Standard]
# no full, only partial
$ caniuse --oneline 'svg favicon'
SVG favicons [WHATWG Living Standard]
# no support
$ caniuse --oneline placeholder-shown
:placeholder-shown CSS pseudo-class [W3C Working Draft]
with the expected:
# only full, no partial
$ caniuse --oneline --current hidden
hidden attribute โ 92.16% [WHATWG Living Standard]
# full and partial
$ caniuse --oneline spellcheck
Spellcheck attribute โ 54.57% โ 39.3% [WHATWG Living Standard]
# no full, only partial
$ caniuse --oneline 'svg favicon'
SVG favicons โ 10.41% [WHATWG Living Standard]
# no support
$ caniuse --oneline placeholder-shown
:placeholder-shown CSS pseudo-class [W3C Working Draft]
It looks like there's a typo in showFeature
:
diff --git a/caniuse.coffee b/caniuse.coffee
index f5f5050..48f9dff 100644
--- a/caniuse.coffee
+++ b/caniuse.coffee
@@ -150 +150 @@ showFeature = (result, opts={}) ->
- percentages.push "โ #{result.usage_perc_a}%".yellow if result.usage_perc_y
+ percentages.push "โ #{result.usage_perc_a}%".yellow if result.usage_perc_a
Or perhaps this is all intentional (only show the percentages if there's something that fully supports the feature), in which case close away :)
I couldn't find a license with this code. Could you add an open source license? I recommend MIT.
It might be useful.
Hi,
I'm running Pop 22.04 with ZSH. I've tried running npm install -g caniuse-cmd
and sudo npm install -g caniuse-cmd
but I am getting installation error messages -
sudo npm install -g caniuse-cmd
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects clone -b config-booleans ssh://[email protected]/sgentle/yargs.git /root/.npm/_cacache/tmp/git-cloneJvCgYn --recurse-submodules --depth=1
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-cloneJvCgYn': Permission denied
I've npm 8.13.2
It would be nice to add support fot the free desktop XDG base directory specification (https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html), where configurations should be placed in $XDG_CONFIG_HOME/appname
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.