Have ideas to improve npm?Join in the discussion! »

    blade2wp

    0.0.6 • Public • Published

    blade2wp

    Convert Blade(syntax) templates to WordPress

    NPM

    Install:

    npm i blade2wp
    

    Usage:

    const blade2wp = require('blade2wp')
    
    // ... 
    
    const bladeSyntax = "<a href="{{ esc_url($this->get('url') ?? '#') }}" class="wep-button">{{ $this->get('link_text') }}</a>";
    
    // Convert Blade style string to WordPress:
    const content = blade2wp(bladeSyntax) 
    
    // "content" equals to: 
    //  
    // <a href="<?php echo esc_url($this->get('url') ?? '#') ?>" class="wep-button"><?php echo $this->get('link_text') ?></a>
    //
    

    Keywords

    none

    Install

    npm i blade2wp

    DownloadsWeekly Downloads

    0

    Version

    0.0.6

    License

    ISC

    Unpacked Size

    5.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar