https://github.com/cheminfo/ensure-string
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Basic Info
- Host: GitHub
- Owner: cheminfo
- License: mit
- Language: TypeScript
- Default Branch: main
- Homepage: https://cheminfo.github.io/ensure-string/
- Size: 1.22 MB
Statistics
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
ensure-string
If required, convert the input value to a string.
The input value may be a Buffer, ArrayBuffer, Int8Array.
By default the conversion will consider that the text encoding is utf-8.
If the file contains an UTF-16 byte-order mark (BOM), this will be detected and default to utf-16le or utf-16be accordingly.
If the input value is a text, no change is done. The method returns the value without further processing.
Installation
$ npm i ensure-string
Usage
We have a text.txt file containing the string ABC.
js
import { ensureString } from '..';
import { readFileSync } from 'fs';
import { join } from 'path';
const blob = readFileSync(join(__dirname, 'test.txt')); // read the file as an ArrayBuffer
const text = ensureString(blob);
console.log(text); // the text is a string containing ÀBC`
API Documentation
License
Owner
- Name: Cheminfo
- Login: cheminfo
- Kind: organization
- Website: https://www.cheminfo.org/
- Repositories: 242
- Profile: https://github.com/cheminfo
GitHub Events
Total
Last Year
Committers
Last synced: about 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Luc Patiny | l****c@p****m | 11 |
| Luc Patiny | l****y@u****m | 8 |
| cheminfo-bot | 1****t@u****m | 5 |
| Michaël Zasso | t****s@p****m | 3 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 1
- Total pull requests: 8
- Average time to close issues: about 1 hour
- Average time to close pull requests: about 2 hours
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 1.5
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- targos (1)
Pull Request Authors
- cheminfo-bot (5)
- lpatiny (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 10,372 last-month
- Total dependent packages: 14
- Total dependent repositories: 28
- Total versions: 5
- Total maintainers: 1
npmjs.org: ensure-string
Ensure that we receive a text even if an ArrayBuffer is sent
- Homepage: https://github.com/cheminfo/ensure-string#readme
- License: MIT
-
Latest release: 1.2.0
published about 4 years ago
Rankings
Maintainers (1)
Dependencies
- @types/jest ^27.4.1 development
- eslint ^8.13.0 development
- eslint-config-cheminfo-typescript ^10.4.0 development
- jest ^27.5.1 development
- prettier ^2.6.2 development
- rimraf ^3.0.2 development
- ts-jest ^27.1.4 development
- typescript ^4.6.3 development
- cheminfo-types ^1.1.0
- isutf8 ^4.0.0