Skip to content

Callback that allows to sort the chemical elements (or atoms) using the 'Hill' convention

License

Notifications You must be signed in to change notification settings

cheminfo-js/atom-sorter

Repository files navigation

atom-sorter

NPM version build status Test coverage David deps npm download

Callback allowing to sort chemical elements (atoms) in Hill order

Installation

$ npm install atom-sorter

Example

const atomSorter = require('atom-sorter');

let atoms = ['H', 'Cl', 'C', 'O', 'N', 'Br'];
atoms.sort((a, b) => atomSorter(a, b));

// ['C', 'H', 'Br', 'Cl', 'N', 'O']

License

MIT

About

Callback that allows to sort the chemical elements (or atoms) using the 'Hill' convention

Resources

License

Stars

Watchers

Forks

Packages

No packages published