ects-roboworkfuture
v1.0.1
Published
Convert a score in the 100-point grading system to its corresponding ECTS letter grade.
Maintainers
Readme
ects-roboworkfuture
Convert numerical scores into ECTS letter grades with ease.
This lightweight package converts scores from the traditional 100‑point grading system into European Credit Transfer and Accumulation System (ECTS) letter grades (A through F).
The mapping used by this package adheres to the commonly accepted ranges:
| Score range | ECTS grade | |------------:|:-----------| | 90 – 100 | A | | 82 – 89 | B | | 74 – 81 | C | | 65 – 73 | D | | 60 – 64 | E | | 0 – 59 | F |
Installation
npm install ects-roboworkfutureQuick start
CommonJS
const ECTS = require('ects-roboworkfuture');
const calculator = new ECTS(85);
console.log(calculator.ectsFromScore()); // → 'B'ES module
import ECTS from 'ects-roboworkfuture';
const calculator = new ECTS(92);
console.log(calculator.ectsFromScore()); // → 'A'API
new ECTS(score: number)
Creates a new converter instance for a given score in the 100‑point system. The constructor validates that the provided score is a number.
ectsFromScore(): 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
Returns the ECTS letter grade corresponding to the instance’s score. If the score is outside the 0–100 range, a RangeError is thrown.
Why use this package?
- Reliable mapping: Implements the standard score‑to‑ECTS conversion.
- Simple API: A single class with a clear method for conversion.
- Modern packaging: Supports both CommonJS
require()and ES moduleimportsyntax, and ships with TypeScript definitions. - Zero dependencies: Keeps your bundle lean.
License
MIT © Robofuture
