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

magique

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magique

A utility for creating HTML tags in JavaScript.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Magique

Magique is a dead-simple, highly-readable way to write HTML in JavaScript. It's particularly designed for templating, so if you find yourself writing a lot of wrapping tags (like and ) around strings, you'll find this package useful.

Example

import { b, i } from 'magique';

b('hello') // yields <strong>hello</strong>
i('hello') // yields <em>hello</em>

Usage

TypeScript/ES6

import { bold } from 'magique';
bold('hello');

/* OR */

import * as magique from 'magique';
magique.bold('hello');

ES5

var magique = require('magique');
magique.bold('hello');

/* OR */

var bold = require('magique').bold;
bold('hello');

Supported Tags and Aliases

TagAliasesReturnsUsage
bbold, strongstrb(str)
iitalic, emstri(str)
alinkstr or stra(str) OR a(str, href)
brN/A
br()
hXheaderstrh(level)(str) where level is between 1 and 6
h1, h2, h3, h4, h5, h6N/A

str

h1(str)

FAQs

Package last updated on 28 Dec 2017

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