https://github.com/gitfaf/node-punctuation-stats
A small library for getting stats on punctuation in files. - Node Module
https://github.com/gitfaf/node-punctuation-stats
node node-module node-punctuation-stats punctuation stats
Last synced: 5 days ago
JSON representation
A small library for getting stats on punctuation in files. - Node Module
- Host: GitHub
- URL: https://github.com/gitfaf/node-punctuation-stats
- Owner: gitfaf
- License: mit
- Created: 2018-01-06T14:35:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-15T12:42:22.000Z (over 7 years ago)
- Last Synced: 2025-04-23T00:19:19.750Z (28 days ago)
- Topics: node, node-module, node-punctuation-stats, punctuation, stats
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# node-punctuation-stats
A small library for getting stats on punctuation in files. - Node Module
## Usage
```javascript
var PS = require('node-punctuation-stats')
var p = new PS()
p.inFile('./index.js')
{ punctuations: [ '!', '?', '.', ',', ';', ':' ],
found:
[ { symbol: '!', count: 1 },
{ symbol: '?', count: 1 },
{ symbol: '.', count: 17 },
{ symbol: ',', count: 12 },
{ symbol: ';', count: 1 },
{ symbol: ':', count: 8 } ],
total: 40,
message: 'Found 40 punctuations of 6 types: ! ? . , ; :'
}const data = fs.readFileSync('./index.js').toString()
p.inText(data)
{ punctuations: [ '!', '?', '.', ',', ';', ':' ],
found:
[ { symbol: '!', count: 1 },
{ symbol: '?', count: 1 },
{ symbol: '.', count: 17 },
{ symbol: ',', count: 12 },
{ symbol: ';', count: 1 },
{ symbol: ':', count: 8 } ],
total: 40,
message: 'Found 40 punctuations of 6 types: ! ? . , ; :'
}p.inDir('./', '.js')
[
{
file: 'index.js',
found:
{
punctuations: [Array],
found: [Array],
total: 50,
message: 'Found 50 punctuations of 6 types: ! ? . , ; :'
}
}
]```
## Licensce
MIT © 2018 Git Faf