@nhatnguyet/bazi 0.0.0-stage → 0.3.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nhat Nguyet (nhatnguyet.org)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # @nhatnguyet/bazi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ BaZi (Four Pillars of Destiny, 八字) by solar term, to the minute: pillars,
4
+ hidden stems, Ten Gods, symbolic stars, luck pillars, minor luck, SVG. No external
5
+ dependencies, TypeScript types, Node 18+ and browsers.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i @nhatnguyet/bazi
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```js
16
+ import { castBaZi, minorLuck } from "@nhatnguyet/bazi";
17
+
18
+ const bz = castBaZi({ date: "1990-09-19", time: "20:00", gender: "male" });
19
+ const { year, month, day, hour } = bz.pillars;
20
+ console.log(year.label, "|", month.label, "|", day.label, "|", hour.label);
21
+ console.log(bz.dayMaster.stem, bz.dayMaster.element, bz.dayMaster.yinYang);
22
+ console.log(bz.luck.startAge.years, bz.luck.pillars.slice(0, 3).map((p) => p.label).join(", "));
23
+ console.log(minorLuck(bz, 2026).label);
24
+ ```
25
+
26
+ ```text
27
+ Geng Wu | Yi You | Ding Hai | Geng Xu
28
+ Ding Fire Yin
29
+ 6 Bing Xu, Ding Hai, Wu Zi
30
+ Ding Hai
31
+ ```
32
+
33
+ ## API
34
+
35
+ | Function | Returns |
36
+ |---|---|
37
+ | `castBaZi({ date, time, gender, lang, terms, schools })` | the four pillars with `tenGod`, `hiddenStems`, `naYin`, `stage`, `stars`; `dayMaster`; `luck` (start age and luck pillars); `bz.toSvg()` draws it |
38
+ | `minorLuck(bz, year)` | the minor luck pillar of a year |
39
+ | `baZiSvg(bz, { theme, width, lang, name })` | the SVG chart |
40
+
41
+ `time` may be `null` (no hour pillar). The year turns at Start of Spring, the
42
+ month at each sectional term, the day at 23:00 (`schools: { ziHour:
43
+ "split-at-midnight" }` to keep the entered date). Every option:
44
+ [English API](https://github.com/Nhat-Nguyet/nhatnguyet-lunar-ziwei-bazi-numerology/blob/main/docs/api-en.md#bazi-nhatnguyetbat-tu).
45
+
46
+ This package is the English name of
47
+ [`@nhatnguyet/bat-tu`](https://www.npmjs.com/package/@nhatnguyet/bat-tu), which
48
+ holds the implementation; both export the same functions. Results match the
49
+ engine behind [nhatnguyet.org](https://nhatnguyet.org/en/ma-nguon-mo) on every
50
+ shared test vector. Python: `pip install nhatnguyet`.
51
+
52
+ Data: Nhat Nguyet (nhatnguyet.org). MIT License.
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "@nhatnguyet/bat-tu";
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@nhatnguyet/bat-tu";
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@nhatnguyet/bazi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0",
4
+ "description": "BaZi (Four Pillars of Destiny, 八字) by solar term: pillars, hidden stems, Ten Gods, symbolic stars, luck periods, SVG. English-named alias of @nhatnguyet/bat-tu.",
5
+ "license": "MIT",
6
+ "author": "Nhat Nguyet (https://nhatnguyet.org)",
7
+ "homepage": "https://nhatnguyet.org/en/ma-nguon-mo",
8
+ "keywords": [
9
+ "bazi",
10
+ "four pillars",
11
+ "八字",
12
+ "four pillars of destiny",
13
+ "ten gods",
14
+ "luck pillars",
15
+ "ba zi",
16
+ "chinese astrology",
17
+ "heavenly stems",
18
+ "earthly branches",
19
+ "solar terms",
20
+ "saju",
21
+ "bat tu",
22
+ "tu tru",
23
+ "bát tự",
24
+ "四柱",
25
+ "四柱八字",
26
+ "八字排盘",
27
+ "十神",
28
+ "神煞",
29
+ "nhat nguyet",
30
+ "vietnam",
31
+ "vietnamese",
32
+ "typescript",
33
+ "no external dependencies"
34
+ ],
35
+ "type": "module",
36
+ "main": "./index.js",
37
+ "types": "./index.d.ts",
38
+ "exports": {
39
+ ".": {
40
+ "types": "./index.d.ts",
41
+ "default": "./index.js"
42
+ }
43
+ },
44
+ "files": [
45
+ "index.d.ts",
46
+ "index.js"
47
+ ],
48
+ "dependencies": {
49
+ "@nhatnguyet/bat-tu": "^0.3.0"
50
+ },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/Nhat-Nguyet/nhatnguyet-lunar-ziwei-bazi-numerology.git",
54
+ "directory": "js/packages/bazi"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "bugs": {
60
+ "url": "https://github.com/Nhat-Nguyet/nhatnguyet-lunar-ziwei-bazi-numerology/issues"
61
+ }
62
+ }