0.0.0 ā¢ Published 2 years ago
@genious/g9 v0.0.0
@genious/g9
š Unique property keys.
Installation
Install G9 using your favorite package manager.
$ npm i @genious/g9
Usage
To use one of the keys, e.g. dataName
, import the submodule from the parent module.
import { dataName } from '@genious/g9';
Or import the key using the appropriate subpath.
import dataName from '@genious/g9/dataName';
dataName
Symbol that specifies the name of the file (String
or URL
) at the origin of Data
object.
- type
{symbol}
class Data {
#srcName;
constructor(name) {
this.#srcName = name;
}
get [dataName]() {
return this.#srcName;
}
static readFile(path) {
return new Data(path);
}
}
const obj = Data.readFile('./hello.md');
console.log(obj[dataName]);
// './hello.md'
Authors
Aziz Da azizdawhat@gmail.com
License
0.0.0
2 years ago