New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

noliter

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

noliter

Write code with no literal and get tiny bundle

  • 0.7.1
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-30%
Maintainers
1
Weekly downloads
 
Created
Source

build npm license

Noliter

Write code with no literal and get tiny bundle

Install

npm install noliter

API

Constants

DOM manipulation

ga/sa

ga is abbreviation of get attribute.
sa is abbreviation of set attributes.

import {
  $,
  TAG_NAME_DIV,
  ATTR_ID,
  ATTR_CLASS
} from 'noliter';

const div = $(TAG_NAME_DIV)
  .sa(
    ATTR_ID, 'my-id',
    ATTR_CLASS, 'class-name'
  );

div.ga(ATTR_ID) === 'my-id';
div.ga(ATTR_CLASS) === 'class-name';
gp/sp

gp is abbreviation of get property.
sp is abbreviation of set properties.

import {
  $,
  TAG_NAME_INPUT,
  PROP_CHECKED,
  PROP_DISABLED
} from 'noliter';

const input = $(TAG_NAME_INPUT)
  .sp(
    PROP_CHECKED, true,
    PROP_DISABLED, true
  );

div.gp(PROP_CHECKED) === true;
div.gp(PROP_DISABLED) === true;
add

This method appends multiple parameters as children.
You can pass string or element or instance.

import {
  $,
  TAG_NAME_DIV
} from 'noliter';

$(TAG_NAME_DIV)
  .add(
    'text',
    document.createElement('div'),
    $(TAG_NAME_DIV)
  );
on

It's same with addEventListener method.

import {
  $,
  TAG_NAME_BUTTON,
  EVENT_TYPE_BLUR,
  EVENT_TYPE_FOCUS
} from 'noliter';

$(TAG_NAME_BUTTON)
  .add('click me')
  .on(
    EVENT_TYPE_BLUR,
    () => console.log('blur')
  )
  .on(
    EVENT_TYPE_FOCUS,
    () => console.log('focus'),
    { passive: true }
  );

Keywords

FAQs

Package last updated on 25 Oct 2020

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