Skip to content
On this page

Science

Module to generate science related entries.

chemicalElement

Returns a random periodic table element.

Returns: ChemicalElement

ts
faker.science.chemicalElement(): ChemicalElement
faker.science.chemicalElement() // => {"symbol":"Tb","name":"Terbium","atomicNumber":65}
faker.science.chemicalElement() // { symbol: 'H', name: 'Hydrogen', atomicNumber: 1 }
faker.science.chemicalElement() // { symbol: 'Xe', name: 'Xenon', atomicNumber: 54 }
faker.science.chemicalElement() // { symbol: 'Ce', name: 'Cerium', atomicNumber: 58 }

unit

Returns a random scientific unit.

Returns: Unit

ts
faker.science.unit(): Unit
faker.science.unit() // => {"name":"watt","symbol":"W"}
faker.science.unit() // { name: 'meter', symbol: 'm' }
faker.science.unit() // { name: 'second', symbol: 's' }
faker.science.unit() // { name: 'mole', symbol: 'mol' }

Released under the MIT License.