Skip to content

Commit 24dbf5e

Browse files
committed
feat: clean up toJSON and work in progress
add .prettierrc.json
1 parent 7315559 commit 24dbf5e

17 files changed

+454
-198171
lines changed

.prettierrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "always",
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"semi": true,
6+
"trailingComma": "all"
7+
}

README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# nmredata parser
2+
23
<p align="center">
34
A tool for reading nmrRecords.
45
</p>
@@ -17,28 +18,28 @@
1718
const nmredata = require('nmredata');
1819

1920
const path = 'pathToNMRRecordFile';
20-
var record = nmredata.readNMRRSync(path);
21+
var record = nmredata.readNmrRecordSync(path);
2122
/**
2223
* record has all sdf files and spectra data inside of nmrRecord file.
2324
*/
2425
let nbSDFFiles = record.nbSamples;
2526
let sdfList = record.getSDFList(); // it's return ["wild_JCH_coupling","only_one_HH_coupling_in_Jtag","compound1.nmredata","compound1_with_jcamp.nmredata","with_char_10","compound1_special_labels.nmredata copy"]
2627
/**
2728
* if several sdf file exists
28-
* the first readed is set as activeElement, it means that you don't need
29+
* the first readed is set as activeElement, it means that you don't need
2930
* to pass a filename for each operation on the same SDF file.
3031
* It's possible to get or set (filename or index) an activeElement.
3132
*/
3233
let activeElement = record.getActiveElement(); //should return 'wild_JCH_coupling'
3334
record.setActiveElement('only_one_HH_coupling_in_Jtag');
3435

3536
/**
36-
* You can get the text of all tags of a specific sdf file (filename or index) with
37-
* getNMReDataTags, it returns an object where each tag is a property
38-
* with their value in text
37+
* You can get the text of all tags of a specific sdf file (filename or index) with
38+
* getNMReDataTags, it returns an object where each tag is a property
39+
* with their value in text
3940
**/
4041
let allTags = record.getNMReDataTags(); //return the tags of 'only_one_HH_coupling_in_Jtag'
41-
// you can get a specific tag
42+
// you can get a specific tag
4243
let solvent = allTags['SOLVENT']
4344
// To get one list with the current's tags
4445
let tagsList = Object.keys(allTags);
@@ -59,10 +60,10 @@ var record = nmredata.readNMRRSync(path);
5960

6061
// Asynchronously, to be used in the browser or another node packages
6162
const nmredata = require('nmredata');
62-
const FS = require('fs');
63-
const path = 'pathToNMRRecordFile'
64-
var zipData = FS.readFileSync(path);
65-
nmredata.readNMRR(zipData).then(currentNMRrecord => {
63+
const { readFileSync } = require('fs');
64+
const path = 'pathToNMRRecordFile';
65+
var zipData = readFileSync(path);
66+
nmredata.readNmrRecord(zipData).then(currentNMRrecord => {
6667
// you can do the same as above
6768
});
6869

@@ -71,5 +72,5 @@ nmredata.readNMRR(zipData).then(currentNMRrecord => {
7172
```
7273

7374
## License
74-
[MIT](./LICENSE)
75-
75+
76+
[MIT](./LICENSE)

0 commit comments

Comments
 (0)