Skip to content


This function is part of Iconify Utils package.

Function quicklyValidateIconSet() validates icon set, returning cleaned up IconifyJSON object.

If there are errors in provided data, it will return null.

This function does not check metadata.


Function has the following parameter:

  • data, object. Data to validate.

Function returns:

  • IconifyJSON object on success (same as passed in first parameter).
  • null on error.


tsimport { promises as fs } from 'fs';
import { quicklyValidateIconSet } from '@iconify/utils';

(async () => {
   // Load data from file
   const data = JSON.parse(
       await fs.readFile(

   // Validate data
   const iconSet = quicklyValidateIconSet(data);
   if (!iconSet) {
       console.error('Bad icon set');

   // Count icons (simple calculation)
   const count =
       Object.keys(iconSet.icons).length +
       (iconSet.aliases ? Object.keys(iconSet.aliases).length : 0);
   console.log(`Found ${count} icons`);

Advanced validation

This function is optimised for bundle size and performance, therefore it does only basic validation.

If you want to fully validate icon set, use validateIconSet() instead.

Released under the Apache 2.0 License.