atom-sorter
Advanced tools
Comparing version 0.0.4 to 0.4.2
{ | ||
"name": "atom-sorter", | ||
"version": "0.0.4", | ||
"version": "0.4.2", | ||
"description": "Callback allowing to sort chemical elements (atoms) in Hill order", | ||
"main": "./src/index.js", | ||
"main": "src/index.js", | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
"eslint": "eslint src test", | ||
"eslint-fix": "npm run eslint -- --fix", | ||
"test": "run-s testonly eslint", | ||
"test-travis": "eslint src && jest --coverage && codecov", | ||
"testonly": "jest", | ||
"build": "cheminfo build --no-source-map" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/cheminfo-js/atom-sorter.git" | ||
"url": "git+https://github.com/cheminfo-js/mf-parser.git" | ||
}, | ||
"keywords": [], | ||
"author": "Luc Patiny <luc@patiny.com>", | ||
"author": "Luc Patiny", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/cheminfo-js/atom-sorter/issues" | ||
"url": "https://github.com/cheminfo-js/mf-parser/issues" | ||
}, | ||
"homepage": "https://github.com/cheminfo-js/atom-sorter#readme", | ||
"jest": { | ||
"testEnvironment": "node" | ||
}, | ||
"devDependencies": { | ||
"cheminfo-tools": "^1.20.1", | ||
"codecov": "^3.0.0", | ||
"eslint": "^4.12.0", | ||
"eslint-config-cheminfo": "^1.8.0", | ||
"eslint-plugin-no-only-tests": "^2.0.0", | ||
"jest": "^21.2.1", | ||
"npm-run-all": "^4.1.2" | ||
"homepage": "https://github.com/cheminfo-js/mf-parser/tree/master/packages/atom-sorter#readme", | ||
"dependencies": { | ||
"molecular-formula-generator": "^0.0.0" | ||
} | ||
} |
# atom-sorter | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Test coverage][codecov-image]][codecov-url] | ||
[![David deps][david-image]][david-url] | ||
[![npm download][download-image]][download-url] | ||
Callback allowing to sort chemical elements (atoms) in Hill order | ||
. | ||
## Installation | ||
`$ npm install atom-sorter` | ||
`$ npm install --save atom-sorter` | ||
## [API Documentation](https://cheminfo-js.github.io/atom-sorter/) | ||
## Usage | ||
## Example | ||
```js | ||
const atomSorter = require('atom-sorter'); | ||
import library from 'atom-sorter'; | ||
let atoms = ['H', 'Cl', 'C', 'O', 'N', 'Br']; | ||
atoms.sort((a, b) => atomSorter(a, b)); | ||
// ['C', 'H', 'Br', 'Cl', 'N', 'O'] | ||
const result = library(args); | ||
// result is ... | ||
``` | ||
## License | ||
[MIT](./LICENSE) | ||
[MIT](./LICENSE) | ||
[npm-image]: https://img.shields.io/npm/v/atom-sorter.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/atom-sorter | ||
[travis-image]: https://img.shields.io/travis/cheminfo-js/atom-sorter/master.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/cheminfo-js/atom-sorter | ||
[codecov-image]: https://img.shields.io/codecov/c/github/cheminfo-js/atom-sorter.svg?style=flat-square | ||
[codecov-url]: https://codecov.io/gh/cheminfo-js/atom-sorter | ||
[david-image]: https://img.shields.io/david/cheminfo-js/atom-sorter.svg?style=flat-square | ||
[david-url]: https://david-dm.org/cheminfo-js/atom-sorter | ||
[download-image]: https://img.shields.io/npm/dm/atom-sorter.svg?style=flat-square | ||
[download-url]: https://www.npmjs.com/package/atom-sorter |
'use strict'; | ||
function atomSorter(a, b) { | ||
@@ -5,0 +4,0 @@ if (a === b) return 0; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
0
3142
1
5
29