es-query

1.0.1 • Public • Published

es-query

An utilitarian library for DOM manipulation using ECMAScript 7 Function Bind Syntax.

es-query is only compatible with IE8 or better.

How to use

To use this library you need to install it with NPM using:

npm i -S es-query

Once you finish you can load it in your code with:

import $ from 'es-query';

Or you can load only the required methods with:

import { find, html, each } from 'es-query';

Then you can use it this way:

document.querySelector('section')::$.find('p')::$.each(el => {
  el::$.html('Hello, world!');
});

Or if you only load some modules:

document.querySelector('section')::find('p')::each(el => {
  el::html('Hello, world!');
});

The methods are made to work only with one element at time, so if you have an array of elements you has to use the method each() like in the example before.

List of methods

All the methods works with the same syntax as jQuery.

  • addClass
  • after
  • append
  • attr
  • before
  • children
  • clone
  • contains
  • each
  • empty
  • filter
  • find
  • hasClass
  • html
  • is
  • next
  • off
  • on
  • parent
  • prepend
  • prev
  • removeClass
  • siblings
  • text
  • toggleClass
  • trigger

License

The MIT License (MIT)

Copyright (c) 2015 Sergio Daniel Xalambrí

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i es-query

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • sergiodxa