Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bluscript

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluscript

A domain-specific language for web development

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

BluScript

Version: 1.0.1

A lightweight Domain-Specific Language (DSL) for generating web components.

Installation

npm install bluscript

Quick Start

import { Parser, HTMLGenerator } from 'bluscript';

const code = `
LOGIN PAGE {
  FIELD: username
  FIELD: password
  AUTH: JWT
  ACTION: /login
}
`;

const parser = new Parser(code);
const ast = parser.parse();
const htmlGenerator = new HTMLGenerator();

ast.forEach(command => {
  if (command.type === 'LOGIN') {
    const html = htmlGenerator.generateLoginPage(command);
    console.log(html);
  }
});

Syntax

LOGIN PAGE

Creates a login form with specified fields and configuration.

LOGIN PAGE {
  FIELD: username
  FIELD: password
  AUTH: JWT
  ACTION: /login
}

Parameters:

  • FIELD: Input field (can be specified multiple times)
  • AUTH: Authentication method
  • ACTION: Form submission endpoint

Generated HTML example:

<form action="/login" method="POST">
  <div class="form-group">
    <label for="username">Username</label>
    <input type="text" id="username" name="username" required>
  </div>
  <div class="form-group">
    <label for="password">Password</label>
    <input type="password" id="password" name="password" required>
  </div>
  <button type="submit">Login</button>
</form>

API Reference

Parser

const parser = new Parser(code);
const ast = parser.parse();

HTMLGenerator

const generator = new HTMLGenerator();
const html = generator.generateLoginPage(command);

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see the LICENSE file for details

Keywords

FAQs

Package last updated on 01 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc