@dasmig/persona 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @dasmig/persona
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@dasmig/persona)
|
|
4
|
+
[](https://github.com/dasmig/generator-tech-demo/blob/master/LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/@dasmig/persona)
|
|
6
|
+
[](https://www.npmjs.com/package/@dasmig/persona)
|
|
7
|
+
|
|
3
8
|
Complete fictional characters from one seeded call: name, country, city, birth date and age, body, personality, religion, hobbies, favourite media and job. It is [persona-generator](https://github.com/dasmig/persona-generator) (C++23) compiled to WebAssembly, with the `lite` data of the eight libraries it composes built in, so nothing is fetched at run time but the module's own `persona.wasm`.
|
|
4
9
|
|
|
5
10
|
The output is fictional sample data, not a description or prediction of a real person.
|
|
@@ -16,8 +21,16 @@ createPersonaGenerator().then(personas => {
|
|
|
16
21
|
});
|
|
17
22
|
```
|
|
18
23
|
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
npm install @dasmig/persona
|
|
28
|
+
```
|
|
29
|
+
|
|
19
30
|
The package is an ES module only (no CommonJS build), for browsers, Web Workers and Node 20+.
|
|
20
31
|
|
|
32
|
+
It ships its own TypeScript types (`index.d.ts`) and the WebAssembly module (`persona.wasm`, about 8 MB, under 3 MB compressed), which bundlers such as Vite, webpack and esbuild pick up from `new URL('persona.wasm', import.meta.url)`; pass `locateFile` or `wasmBinary` to `createPersonaGenerator()` to load it some other way. It has no dependencies.
|
|
33
|
+
|
|
21
34
|
## Loading
|
|
22
35
|
|
|
23
36
|
`createPersonaGenerator()` instantiates the module and loads the data of all eight libraries. That takes **a second or two** (about 1.4 s on a desktop, more on a phone) and blocks the thread it runs on, and a generator uses about 90 MB of memory. So:
|
|
@@ -112,6 +125,12 @@ The data comes from open datasets (GeoNames, mledoze/countries, UN World Populat
|
|
|
112
125
|
|
|
113
126
|
Each library documents its data's limits in its own `doc/data.md`.
|
|
114
127
|
|
|
128
|
+
## Versions
|
|
129
|
+
|
|
130
|
+
The package version is its own. `personas.versions` lists the persona-generator release and the library releases this build was made from (for example `persona-generator: 'v3.0.0'`), and the [releases](https://github.com/dasmig/generator-tech-demo/releases) of the repository say which versions each package release contains. The same seed gives the same persona only for the same library versions, so a library update that changes output is a major version of the package.
|
|
131
|
+
|
|
132
|
+
Source: [generator-tech-demo/package](https://github.com/dasmig/generator-tech-demo/tree/master/package). Issues: [github.com/dasmig/generator-tech-demo/issues](https://github.com/dasmig/generator-tech-demo/issues).
|
|
133
|
+
|
|
115
134
|
## Licence
|
|
116
135
|
|
|
117
136
|
MIT for the code; see `DATA_LICENSES.txt` for the data.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dasmig/persona",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Complete fictional characters (name, country, city, birth, body, personality, interests, job) from one seeded call, in WebAssembly.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|