
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
fa-constants
Advanced tools
A list of all font awesome icons as js object. Font Awesome by Dave Gandy - http://fontawesome.io
No need to search in the fontawesome list, whether you have written the fa-{{key}} pattern correct or not. This package makes your IDE resolve the list of currently available (latest stable) icon classnames.
Font awesome is distributed under it's own license. This package does not claim any ownership on font awesome.
Use npm to install the package from the npm registry:
npm install --save fa-constants
Import the package to your code:
import { fa } from 'fa-constants';
or use a renamed import in case you want to name it different:
import { fa as FaConstants } from 'fa-constants';
Use autocompletion on your IDE to reveal the full list of keys in fa
.
Example: insert gif here
Creates a font awesome class from a given icon id.
Example:
// icon id is 'file-o'
fa.toClass(fa.fileo); // 'fa fa-file-o'
Creates a key from a given icon id, that can be attached to an object and can trigger auto completion.
Note, that all minus (-
) characters are stripped to achieve this.
Example:
// icon id is 'file-o'
fa.toKey('fa-file-o'); // 'fileo
Returns true/false if a given icon id exists.
Example:
Example:
// icon id is 'file-o'
fa.has(fa.fileo); // true
fa.has('file-o'); // true
fa.has('fa-file-o'); // true
fa.has('fa-filez-o'); // false
In order to build this package, you can easily make use of the already existing npm scripts.
All the commands listed bwloe are wrapped into a chained buildall
command. Usually you need only to call this command in order to parse, lint, test and then build the package.
"buildall": "npm run parse && npm run test && npm run build",
At first, the latest fontawesome icon list needs to be parsed into a JSON Object:
"parse": "node parse.js",
Related: ./parse.js
There is a babel build script (for all platforms), that enbles to create a backward compatible ES5 version of the ES6 code:
"build": "node build.js",
"prepublish": "npm run build",
Related: ./build.js
There are two lint scripts (where one is using --fix
) to lint the code using default specifications:
"lint": "eslint -c ./.eslintrc.json ./lib",
"lint-fix": "eslint --fix -c ./.eslintrc.json ./lib"
Note, that lint
is automatically run on test
.
Related: ./.eslintrc.json
The tests can be executed once or in watch mode:
"test": "npm run lint && mocha --timeout 15000 --compilers js:babel-core/register --recursive \"tests/*.tests.js\" \"lib/*.js\"",
"test:watch": "npm test -- --watch",
Related: ./tests/*
You are welcome to open issues and pull requests. Please ensure, that the buildall
command is always passing with 0
exit and that your feature request / pull request is backing some sort of use case.
FAQs
A list of all font awesome icons as js object. Font Awesome by Dave Gandy - http://fontawesome.io
The npm package fa-constants receives a total of 5 weekly downloads. As such, fa-constants popularity was classified as not popular.
We found that fa-constants demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.