https://github.com/mikeal/buddhism.js
Buddhist concepts as JavaScript
https://github.com/mikeal/buddhism.js
Last synced: 3 months ago
JSON representation
Buddhist concepts as JavaScript
- Host: GitHub
- URL: https://github.com/mikeal/buddhism.js
- Owner: mikeal
- Created: 2020-11-04T17:43:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-04T18:49:06.000Z (over 4 years ago)
- Last Synced: 2025-04-14T18:03:24.213Z (3 months ago)
- Size: 2.93 KB
- Stars: 22
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# buddhism.js
Buddhist concepts as JavaScript
## Pratītyasamutpāda (Dependent Origination)
Basic principals.
```js
const a = (_this, that) => {
if (_this) that()
}
const b = (that) => {
const _this = false
// vm knows this will never be called, this code can be dropped
// and will never exist
if (_this) that()
}
const c = (_this) => {
const that = false
// vm knows this will never be called, this code can be dropped
// and will never exist
if (that && _this) return _this
}
```### Twelve-fold chain
As a functional loop.
```js
// Avijjā (Ignorance)
const avijja = (...args) => sankhara(...args)// Saṅkhāra (Conditioning)
const sankhara = (...args) => vinnana(...args)// Viññāṇa (Consciousness)
const vinnana = (...args) => namarupa(...args)// Nāmarūpa (Name & Form)
const namarupa = (...args) => salayatana(...args)// Saḷāyatana (Six Sense Bases)
const salayatana = (...args) => phassa(...args)// Phassa (Contact)
const phassa = (...args) => vedana(...args)// Vedanā (Sensation)
const vedana = (...args) => tanha(...args)// Taṇhā (Craving)
const tanha = (...args) => upadana(...args)// Upādāna (Clinging)
const upadana = (...args) => bhava(...args)// Bhava (Being)
const bhava = (...args) => jati(...args)// Jāti (Birth)
const jati = (...args) => jaramarana(...args)// Jarāmaraṇa (Old Age & Death)
const jaramarana = (...args) => avijja(...args)
```