JavaScript port of IdeaV Local using Bun, Express, and Links Notation with Link Foundation tools.
- Bun + Express server with Links Notation endpoints
- Full CRUD API for link database operations via
@link-foundation/links-client - ILinks API compatible with Platform.Data interface
- RecursiveLinks API for nested data structures and Links Notation conversions
- Objects API for hierarchical object storage (compatible with ideav/local data model)
- Filtering capabilities with text, numeric, range, and reference operations
- Export/Import support for Links Notation, JSON, and CSV formats
- CLI arguments via
lino-argumentsfor--port,--host,--db-path - lino-arguments configuration from CLI args, env vars, and
.lenvfile - Cross-runtime testing with
test-anywhere
Install link-cli globally (requires .NET):
dotnet tool install --global clinkbun install
# or
npm install# Development mode with hot reload
bun run dev
# Production mode
bun run start
# With CLI arguments
bun run start -- --port 8080 --host 127.0.0.1
# or
bun run start -- -p 8080 -h 127.0.0.1
# With custom database path
bun run start -- --db-path /path/to/db.linkscurl http://localhost:3000/health
# Response: (status: ok)curl -X POST http://localhost:3000/parse \
-H 'Content-Type: text/plain' \
--data '(status: ok)'All responses use Links Notation format: (id: source target)
Create a link:
# Using Links Notation
curl -X POST http://localhost:3000/links \
-H 'Content-Type: text/plain' \
--data '(100 200)'
# Using JSON
curl -X POST http://localhost:3000/links \
-H 'Content-Type: application/json' \
--data '{"source": 100, "target": 200}'
# Response: (1: 100 200)Read all links:
curl http://localhost:3000/links
# Response:
# (1: 100 200)
# (2: 300 400)Read a specific link:
curl http://localhost:3000/links/1
# Response: (1: 100 200)Update a link:
curl -X PUT http://localhost:3000/links/1 \
-H 'Content-Type: application/json' \
--data '{"source": 100, "target": 500}'
# Response: (1: 100 500)Delete a link:
curl -X DELETE http://localhost:3000/links/1
# Response: (deleted: ok)Advanced API compatible with the Platform.Data ILinks interface.
Count links:
curl -X POST http://localhost:3000/ilinks/count \
-H 'Content-Type: application/json' \
--data '{"restriction": null}'
# Response: (count: 5)Iterate through links:
curl -X POST http://localhost:3000/ilinks/each \
-H 'Content-Type: application/json' \
--data '{"restriction": [100, 0]}'
# Response: All links with source=100Create via ILinks:
curl -X POST http://localhost:3000/ilinks/create \
-H 'Content-Type: application/json' \
--data '{"substitution": [100, 200]}'
# Response: (1: 100 200)Update via ILinks:
curl -X POST http://localhost:3000/ilinks/update \
-H 'Content-Type: application/json' \
--data '{"restriction": [1], "substitution": [100, 500]}'
# Response: (1: 100 500)Delete via ILinks:
curl -X POST http://localhost:3000/ilinks/delete \
-H 'Content-Type: application/json' \
--data '{"restriction": [1]}'
# Response: (deleted: 1)Work with nested arrays and objects, converting to/from Links Notation.
Create from nested array:
curl -X POST http://localhost:3000/recursive/from-array \
-H 'Content-Type: application/json' \
--data '{"data": [[1, 2], [3, 4]]}'
# Response: (created: [linkId1, linkId2])Convert to Links Notation:
curl -X POST http://localhost:3000/recursive/to-notation \
-H 'Content-Type: application/json' \
--data '{"data": [[1, 2], [3, 4]]}'
# Response: ((1 2) (3 4))Parse Links Notation:
curl -X POST http://localhost:3000/recursive/from-notation \
-H 'Content-Type: application/json' \
--data '{"notation": "((1 2) (3 4))"}'
# Response: (data: [[1, 2], [3, 4]])Store and manage hierarchical objects with type, parent, order, and value attributes.
Create an object:
curl -X POST http://localhost:3000/objects \
-H 'Content-Type: application/json' \
--data '{"t": 1, "up": 0, "ord": 1, "val": 100}'
# Response: (1: (t: 1) (up: 0) (ord: 1) (val: 100))List objects:
curl http://localhost:3000/objects
# With filters:
curl "http://localhost:3000/objects?type=1&parent=0"Get object children:
curl http://localhost:3000/objects/1/childrenQuery links with powerful filtering capabilities.
Filter links:
curl -X POST http://localhost:3000/links/filter \
-H 'Content-Type: application/json' \
--data '{"filters": {"source": "100", "target": ">150"}, "limit": 10}'Filter operators:
- Equality:
"100"(exact match) - Negation:
"!100"(not equal) - Range:
"10..20"(between 10 and 20) - Greater/Less:
">100","<50",">=100","<=50" - List:
"1,2,3"(in list) - Contains:
"*text*"(contains) - Starts with:
"text*" - Ends with:
"*text" - Reference:
"@123"(reference to object 123)
Export and import links in multiple formats.
Export links:
# Links Notation (default)
curl http://localhost:3000/export
# JSON format
curl "http://localhost:3000/export?format=json"
# CSV format
curl "http://localhost:3000/export?format=csv"Import links:
# Auto-detect format
curl -X POST http://localhost:3000/import \
-H 'Content-Type: text/plain' \
--data '(1: 100 200)
(2: 300 400)'
# JSON format
curl -X POST "http://localhost:3000/import?format=json" \
-H 'Content-Type: application/json' \
--data '[{"source": 100, "target": 200}]'Get list of all available endpoints:
curl http://localhost:3000/apiConfiguration supports three sources with the following priority (highest first):
- CLI arguments:
--port,--host,--db-path - Environment variables:
PORT,HOST,DB_PATH .lenvfile using Links Notation:
server.port: 3000
server.host: 0.0.0.0
db.path: data/linkdb.links
| Option | Alias | Description | Default |
|---|---|---|---|
--port |
-p |
Port to listen on | 3000 |
--host |
-h |
Host to bind to | 0.0.0.0 |
--db-path |
-d |
Path to the links database | data/linkdb.links |
--help |
Show help |
# Run tests
npm test
# Lint code
npm run lint
# Format code
npm run format
# Run all checks
npm run check| Package | Purpose |
|---|---|
@link-foundation/links-client |
Link-cli database client |
links-notation |
Links Notation parser/formatter |
lino-arguments |
CLI args, env vars, and .lenv config |
express |
HTTP server |
test-anywhere |
Cross-runtime testing (dev dependency) |
- Issue #1 - Original requirements
- ideav/local - Original PHP/Python implementation
- link-cli - Links Theory database CLI
- links-client - JavaScript client for link-cli
- links-notation - Data notation format
Unlicense