šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@anodized/tsx

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anodized/tsx

TSX for backend components with Anodized

1.0.21
latest
npm
Version published
Maintainers
1
Created
Source

Anodized TSX

! Still in development until version 1.1 (Meaning any 1.0.* variants won't be production safe!)

Want to use TSX syntax on your controllers with zero overhead and an infinitesimally lower amount of dependencies? Anodized's TSX module is very small, has 0 dependencies (other than typescript, but anodized is based on typescript).

To make your application tsx ready, simply type the command:

npx anodized-tsx init

This will correctly configure your tsconfig to support TSX and decorators

import { Controller, Get } from '@anodized/http';
import { AnodizedTSX } from '@anodized/tsx' // needed for JSX transformation.

@Controller()
class HomepageController
{
    @Get({ path: '/', produces: 'text/html' })
    public showHomepage()
    {
        return (
            <div className='homepage'>
                <p>Hello World</p>
                <button
                    onClick={() => alert('Hello World')}
                >Click me</button>
            </div>
        );
    }

}

Upon running the application and heading to the web address you're hosting on, you should see this dom structure mirrored on the frontend!

Keywords

Anodized

FAQs

Package last updated on 06 Apr 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