JSPM

dollarsigns

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26649F
  • License MIT

Dollar sign wrappers for getElementById and the like

Package Exports

  • dollarsigns

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dollarsigns) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Dollarsigns

A teeny tiny jQuery-inspired library for typing slightly less when working with DOM. It's nothing more than a set of shorthand wrappers really.

What's included?

Almost nothing, really.

  • $ wraps around document.getElementById
  • $$ wraps around document.querySelector
  • $$$ wraps around document.querySelectorAll

Usage

import { $ } from "dollarsigns";
$("message-body").textContent = "It's actually working";

Or if you want all three

import * as DOM from "dollarsigns";

DOM.$("message-body").textContent = "It's actually working";
DOM.$$$(".menu a").forEach(el => (
  el.addEventListener("click", () => console.log("just clicked"))
))

Typescript

Type declarations are included, enjoy.