Skip to content

jzelenkov/periodify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

periodify

Travis Build Status

Compose words from chemical element symbols.

berlin

Usage

var periodify = require('periodify');

periodify('berlin');
// ['B', 'Er', 'Li', 'N']

periodify('brandon');
// [ 'B', 'Ra', 'Nd', 'O', 'N' ]

periodify('ireland');
// [ 'I', 'Re', 'La', 'Nd' ]

periodify('austria');
// []

Pass optional parameter to get full info about each chemical element:

periodify('france', true);
// [
//   { number: 9, weight: 18.9984, name: 'Fluorine', symbol: 'F' },
//   { number: 88, weight: 226, name: 'Radium', symbol: 'Ra' },
//   { number: 7, weight: 14.0067, name: 'Nitrogen', symbol: 'N' },
//   { number: 58, weight: 140.116, name: 'Cerium', symbol: 'Ce' }
// ]

Installation

npm install periodify

Run Tests

npm test

About

Compose words from chemical element symbols

Resources

Stars

Watchers

Forks

Packages

No packages published