napl
TypeScript icon, indicating that this package has built-in type declarations

1.0.62 • Public • Published

NAPL

This is a protocol that turns JSON / YAML into code, allowing it it to modify its own data. This allows applications that pass data to each other and execute code, without recompilation or rebuilding of the code.

NAPL is only meant to perform actions on its own data. Then an application can read from that data and perform other operations.

Basic Types

  • Array: []
  • Object: {}
  • String: ""
  • Number: 0,1,2,3...
  • boolean: true/false

Class Type

  • Object: { updates: [Update] // Other clients issue modification commands through }

Update

Update { id: string // optional identifier for the update timestamp: number // The time of the update path: [string|number] // The path of the item to modify value: value|expresssion // Set to value or expression confirmed: number // Only confirmed updates can be applied. }

  • To perform an update, a program pushes a item into the Update array.
  • The owner of the object performs updates in order of timestamp, then propagates updates.

Demo

https://napl.dobuki.net

Process cycle

  1. CodeParser: Register all types and data-bindings. // => registry / observers / clear updatedPaths
  2. DataUpdateManager: Apply all update logs // => updatedPaths
  3. DataBindingManager: Execute data-bindings // => root data updated
  4. Execute all object code (triggered from observers or loopers) //
  5. Clean up

Readme

Keywords

none

Package Sidebar

Install

npm i napl

Weekly Downloads

120

Version

1.0.62

License

MIT

Unpacked Size

906 kB

Total Files

44

Last publish

Collaborators

  • vincentlequang