System
Generates fake data for many computer systems properties.
commonFileExt
Returns a commonly used file extension.
Available since v3.1.0
Returns: string
faker.system.commonFileExt(): string
faker.system.commonFileExt() // 'gif'
Source
commonFileName
Returns a random file name with a given extension or a commonly used extension.
Available since v3.1.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
ext? | string | Extension. Empty string is considered to be not set. |
Returns: string
faker.system.commonFileName(ext?: string): string
faker.system.commonFileName() // 'dollar.jpg'
faker.system.commonFileName('txt') // 'global_borders_wyoming.txt'
Source
commonFileType
Returns a commonly used file type.
Available since v3.1.0
Returns: string
faker.system.commonFileType(): string
faker.system.commonFileType() // 'audio'
Source
cron
Returns a random cron expression.
Available since v7.5.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
options | { ... } | {} | The optional options to use. |
options.includeNonStandard? | boolean | false | Whether to include a @yearly, @monthly, @daily, etc text labels in the generated expression. |
options.includeYear? | boolean | false | Whether to include a year in the generated expression. |
Returns: string
faker.system.cron(options: {
includeNonStandard: boolean,
includeYear: boolean
} = {}): string
faker.system.cron() // '45 23 * * 6'
faker.system.cron({ includeYear: true }) // '45 23 * * 6 2067'
faker.system.cron({ includeYear: false }) // '45 23 * * 6'
faker.system.cron({ includeNonStandard: false }) // '45 23 * * 6'
faker.system.cron({ includeNonStandard: true }) // '@yearly'
Source
directoryPath
Returns a directory path.
Available since v3.1.0
Returns: string
faker.system.directoryPath(): string
faker.system.directoryPath() // '/etc/mail'
Source
fileExt
Returns a file extension.
Available since v3.1.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
mimeType? | string | Valid mime-type |
Returns: string
faker.system.fileExt(mimeType?: string): string
faker.system.fileExt() // 'emf'
faker.system.fileExt('application/json') // 'json'
Source
fileName
Returns a random file name with extension.
Available since v3.1.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
options | { ... } | {} | An options object. |
options.extensionCount? | number | { max: number, min: number } | 1 | Define how many extensions the file name should have. |
Returns: string
faker.system.fileName(options: {
extensionCount: number | {
max: number,
min: number
}
} = {}): string
faker.system.fileName() // 'faithfully_calculating.u8mdn'
faker.system.fileName({ extensionCount: 2 }) // 'times_after.swf.ntf'
faker.system.fileName({ extensionCount: { min: 1, max: 2 } }) // 'jaywalk_like_ill.osfpvg'
Source
filePath
Returns a file path.
Available since v3.1.0
Returns: string
faker.system.filePath(): string
faker.system.filePath() // '/usr/local/src/money.dotx'
Source
fileType
Returns a file type.
Available since v3.1.0
Returns: string
faker.system.fileType(): string
faker.system.fileType() // 'message'
Source
mimeType
Returns a mime-type.
Available since v3.1.0
Returns: string
faker.system.mimeType(): string
faker.system.mimeType() // 'video/vnd.vivo'
Source
networkInterface
Returns a random network interface.
Available since v7.4.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
options | { ... } | {} | The options to use. |
options.interfaceSchema? | 'index' | 'mac' | 'pci' | 'slot' | faker.helpers.objectKey(['index' | 'slot' | 'mac' | 'pci']) | The interface schema. Can be one of |
options.interfaceType? | 'en' | 'wl' | 'ww' | faker.helpers.arrayElement(['en', 'wl', 'ww']) | The interface type. Can be one of |
Returns: string
faker.system.networkInterface(options: {
interfaceSchema: 'index' | 'mac' | 'pci' | 'slot',
interfaceType: 'en' | 'wl' | 'ww'
} = {}): string
faker.system.networkInterface() // 'enp0s3'
faker.system.networkInterface({ interfaceType: 'wl' }) // 'wlo1'
faker.system.networkInterface({ interfaceSchema: 'mac' }) // 'enx000c29c00000'
faker.system.networkInterface({ interfaceType: 'en', interfaceSchema: 'pci' }) // 'enp5s0f1d0'
Source
semver
Returns a semantic version.
Available since v3.1.0
Returns: string
faker.system.semver(): string
faker.system.semver() // '1.1.2'