
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@fortawesome/fa-icon-chooser
Advanced tools
Add it to your JavaScript bundle:
npm install --save @fortawesome/fa-icon-chooser
After the resulting JavaScript bundle has been loaded in the DOM, you can
mount an fa-icon-chooser
in the DOM. Suppose your HTML has a container div
:
<div id="fa-icon-chooser-container"></div>
Then you could write JavaScript like this:
function handleQuery(query) {
// some function that handles queries
}
function getUrlText(url) {
// some function that handles GET requests
}
function handleResult(event) {
const result = event && event.detail;
if (result) {
console.log(`<i class"${result.prefix} ${result.iconName}">`);
}
}
window.addEventListener('DOMContentLoaded', event => {
const container = document.querySelector('#fa-icon-chooser-container');
const el = document.createElement('fa-icon-chooser');
el.handleQuery = handleQuery;
el.getUrlText = getUrlText;
el.addEventListener('finish', handleResult);
container.appendChild(el);
});
See the fa-icon-chooser
API Reference
for details about what you'd need to implement in
handleQuery()
, getUrlText()
, and handleResult()
.
You can also look at some example implementations in this repo's development runtime code.
0.7.0 - 2024-06-05
Family and style selection are now based on drop down selections, and the available values are retrieved from the GraphQL API. This removes the hardcoding of familyStyles and lets the icon chooser work with all available familyStyles for the active version of Font Awesome.
Several slots for messages to indicate the unavailability of certain familyStyles have been removed. They are no longer used, now that the UI only includes in the drop down selectors available familyStyle combinations for the active version of Font Awesome.
The following slots have been removed:
light-requires-pro
thin-requires-pro
duotone-requires-pro
sharp-solid-requires-pro
sharp-regular-requires-pro
sharp-light-requires-pro
uploaded-requires-pro
sharp-solid-style-filter-sr-message
sharp-regular-style-filter-sr-message
sharp-light-style-filter-sr-message
solid-style-filter-sr-message
regular-style-filter-sr-message
light-style-filter-sr-message
thin-style-filter-sr-message
duotone-style-filter-sr-message
brands-style-filter-sr-message
uploaded-style-filter-sr-message
The QueryHandler
type now takes a second optional argument for variables.
(See also Breaking Changes)o
The icon chooser's queries now use variables, instead of interpolating all values
into a single query document string. Thus, any QueryHandler
callback must be updated
to handle the query variables.
Its type signature is now:
export type QueryHandler = (document: string, variables?: object) => Promise<any>;
Suggestion:
async function handleQuery(query, variables) {
const headers = buildHeaders()
const url = getApiUrl()
const body = JSON.stringify({query, variables})
return fetch(url, {
method: "POST",
headers,
body
})
}
FAQs
Font Awesome Icon Chooser
The npm package @fortawesome/fa-icon-chooser receives a total of 446 weekly downloads. As such, @fortawesome/fa-icon-chooser popularity was classified as not popular.
We found that @fortawesome/fa-icon-chooser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.