commonFileExtensions

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.extension

This function allows you to get an array of common file extensions with or without the dot. You can filter extensions by types:

  • audio
  • compressed
  • data
  • disc
  • email
  • executable
  • font
  • image
  • media
  • programming
  • text
  • video
  • web

Params

  1. settings{}TCommonFileExtensionsSettings

    Settings to customize the function behavior

Return

  1. -Array<String>

    The array of extensions

Example

import { commonFileExtensions } from '@blackbyte/sugar/extension';
const extensions = commonFileExtensions(); // => ['avi','mp3',...]

Settings

  1. types{(‘esm’|‘cjs’)[]}Types

    An array of types to include in the result

  2. dotfalseboolean

    If true, the dot will be added to the extension

  3. exclude{(‘esm’|‘cjs’)[]}Array<String>

    An array of extensions to exclude

  4. extendedfalseboolean

    If true, the extended formats will be included