TuskLang API Integration

One API. Nine Languages.

TuskLang works seamlessly with PHP, JavaScript, Python, Bash, Go, C#, Rust, Ruby, and Java.
Simple, consistent, powerful.

PHP + TuskLang

Native PHP integration with familiar syntax. Perfect for Laravel, Symfony, or vanilla PHP projects. Your configs feel right at home.

  • PSR-4 autoloading compatible
  • Laravel service provider included
  • Composer package available
  • PHP 7.4+ support
app.php
<?php
// Load TuskLang parser
use TuskLang\Parser;

// Simple configuration file
$config = TuskLang::parse('config.tsk');

// Access nested values
$dbHost = $config['database']['host'];
$port = $config['server']['port'] ?? 8080;

// Use @ operators
$apiKey = $config['api_key']; // @env("API_KEY")

JavaScript + TuskLang

Modern ES6+ support with async/await. Works perfectly with Node.js, React, Vue, and any JavaScript framework you love.

  • NPM package available
  • TypeScript definitions included
  • Promise-based API
  • ES6 modules support
app.js
// Import TuskLang parser
import { TuskLang } from 'tusklang';

// Parse configuration asynchronously
const config = await TuskLang.parseAsync('config.tsk');

// Access configuration values
const apiEndpoint = config.api.endpoint;
const timeout = config.request.timeout || 5000;

// Use with Express.js
app.listen(config.server.port);

Python + TuskLang

Pythonic API design with full type hints. Perfect for Django, Flask, FastAPI, and data science projects. Clean and intuitive.

  • PyPI package available
  • Type hints included
  • Django integration
  • Async support
app.py
# Import TuskLang parser
from tusklang import TuskLang

# Parse configuration file
config = TuskLang.parse('config.tsk')

# Access nested configuration
database_url = config['database']['url']
debug_mode = config.get('debug', False)

# Use with Django settings
DEBUG = config['debug']
DATABASES = config['databases']

Bash + TuskLang

Shell scripting made simple. Perfect for DevOps, automation, and system administration. Clean syntax for config management.

  • POSIX compatible
  • Environment variable support
  • Docker integration
  • CI/CD friendly
deploy.sh
#!/bin/bash

# Load TuskLang configuration
eval "$(tusklang parse config.tsk --export)"

# Use configuration variables
docker run -p $SERVER_PORT:80 \
  -e DATABASE_URL=$DB_URL \
  $DOCKER_IMAGE

# Access nested values
echo "Deploying to: $DEPLOY_TARGET"

Go + TuskLang

Concurrent configuration loading with Go's performance. Perfect for microservices, APIs, and high-performance applications.

  • Go modules support
  • Concurrent parsing
  • Struct unmarshaling
  • Zero dependencies
main.go
package main

import (
    "github.com/cyber-boost/tusktsk-go"
)

func main() {
    // Parse configuration
    config, err := tusklang.ParseFile("config.tsk")
    if err != nil {
        panic(err)
    }

    // Access values
    port := config.GetInt("server.port")
}