🍐 The modern jQuery alternative

Overview

🍐 Nashi

🚧 Work in progress

The modern jQuery alternative.

Motivation

Write this:

nashi('p').text('hello').addClass('foo').toggleClass('bar');

Not that:

const p = document.querySelectorAll('p');
for (const item of p) {
    p.innerText = 'hello';
    p.classList.add('foo');
    p.classList.toggle('bar');
}

Get started

pnpm add @akrc/nashi
yarn add @akrc/nashi
npm install @akrc/nashi

And see documention

Comments
  • Event handler types do not include the possibility of the Event parameter.

    Event handler types do not include the possibility of the Event parameter.

    Hey, I have run into one more issue regarding Typescript specifically.

    I am going to use the click QueryResult function as an example.

    Currently, the type is as follows

    click(handler: () => void);
    

    I would like it to change to something like this:

    click(handler: (event?: Event) => void);
    

    This way, we won't need to do something like this:

    const button = nashi.create("button");
    const handleClick = (evt: PointerEvent) => {
      console.log("clicked", evt);
    }
    button.click(handleClick as () => void) // have to typecast to remove Typescript error.
    
    opened by jaymanmatthewsdev 4
  • chore(deps): update dependency vuepress to v2.0.0-beta.50-pre.1

    chore(deps): update dependency vuepress to v2.0.0-beta.50-pre.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vuepress | 2.0.0-beta.59 -> 2.0.0-beta.50-pre.1 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 3
  • Update dependency vuepress to v2.0.0-beta.50-pre.1

    Update dependency vuepress to v2.0.0-beta.50-pre.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vuepress | 2.0.0-beta.59 -> 2.0.0-beta.50-pre.1 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 3
  • Lacking functions

    Lacking functions

    Hey, I have run into usecases where I need specific functions that are not supplied at the moment.

    I understand that it is still early days for this library, and I am really loving it so far! However, I would like these functions to be implemented ASAP as it will make the Dev Ex better in my opinion.

    append - This function would take a list of QueryResult elements and append them as children to the targeted node, as such:

    append(...elements: QueryResult[])
    

    Example:

    const parentElement = nashi.create("div");
    const childElement = nashi.create("p");
    parentElement.append(childElement);
    

    attr - This function would take two strings (the first being the attribute name), and the second being the new value to set the attribute to, as such:

    attr(name: string, value: string)
    

    Example:

    const element = nashi.create("input");
    element.attr("value", "hello world!");
    // OR
    element.attr("type", "text");
    

    I also want the types, such as QueryResult and Input, to be exposed for personal use. If they are already exposed, I wasn't able to find the relevant documentation.

    Thanks heaps!

    • Jayman
    opened by jaymanmatthewsdev 3
  • Bug: throw an unexcepted TypeError:

    Bug: throw an unexcepted TypeError: "x" is not a function

    <body>
      <div class="a">
        <div class="a">
          <div class="a"></div>
        </div>
      </div>
      <script src="https://unpkg.com/@akrc/nashi@latest/dist/legacy.js"></script>
      <script>
        nashi('.a').each((el) => {
          el.style.backgroundColor = 'red';
        });
      </script>
    </body>
    

    in console, it will return legacy.js:4 Uncaught TypeError: t is not a function

    bug 
    opened by wibus-wee 2
  • chore(deps): update dependency eslint-config-akrc to ^0.0.12

    chore(deps): update dependency eslint-config-akrc to ^0.0.12

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | eslint-config-akrc | ^0.0.11 -> ^0.0.12 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update typescript-eslint monorepo to v5.47.1

    chore(deps): update typescript-eslint monorepo to v5.47.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @typescript-eslint/eslint-plugin | 5.47.0 -> 5.47.1 | age | adoption | passing | confidence | | @typescript-eslint/parser | 5.47.0 -> 5.47.1 | age | adoption | passing | confidence |


    Release Notes

    typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)

    v5.47.1

    Compare Source

    Bug Fixes
    • ast-spec: correct some incorrect ast types (#​6257) (0f3f645)
    • eslint-plugin: [member-ordering] correctly invert optionalityOrder (#​6256) (ccd45d4)
    typescript-eslint/typescript-eslint (@​typescript-eslint/parser)

    v5.47.1

    Compare Source

    Note: Version bump only for package @​typescript-eslint/parser


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency vitest to v0.26.2

    chore(deps): update dependency vitest to v0.26.2

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vitest | 0.26.1 -> 0.26.2 | age | adoption | passing | confidence |


    Release Notes

    vitest-dev/vitest

    v0.26.2

    Compare Source

       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency eslint-config-akrc to ^0.0.11

    chore(deps): update dependency eslint-config-akrc to ^0.0.11

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | eslint-config-akrc | ^0.0.10 -> ^0.0.11 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency vitest to v0.26.1

    chore(deps): update dependency vitest to v0.26.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vitest | 0.26.0 -> 0.26.1 | age | adoption | passing | confidence |


    Release Notes

    vitest-dev/vitest

    v0.26.1

    Compare Source

       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update typescript-eslint monorepo to v5.47.0

    chore(deps): update typescript-eslint monorepo to v5.47.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @typescript-eslint/eslint-plugin | 5.46.1 -> 5.47.0 | age | adoption | passing | confidence | | @typescript-eslint/parser | 5.46.1 -> 5.47.0 | age | adoption | passing | confidence |


    Release Notes

    typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)

    v5.47.0

    Compare Source

    Features
    • eslint-plugin: [no-floating-promises] add suggestion fixer to add an 'await' (#​5943) (9e35ef9)

    5.46.1 (2022-12-12)

    Note: Version bump only for package @​typescript-eslint/eslint-plugin

    typescript-eslint/typescript-eslint (@​typescript-eslint/parser)

    v5.47.0

    Compare Source

    Note: Version bump only for package @​typescript-eslint/parser

    5.46.1 (2022-12-12)

    Note: Version bump only for package @​typescript-eslint/parser


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Ignored or Blocked

    These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

    Detected dependencies

    npm
    package.json
    • @babel/core ^7.20.5
    • @babel/preset-env ^7.20.2
    • @rollup/plugin-babel ^6.0.3
    • @typescript-eslint/eslint-plugin 5.47.1
    • @typescript-eslint/parser 5.47.1
    • @vuepress/client 2.0.0-beta.50-pre.1
    • esbuild ^0.16.7
    • eslint ^8.29.0
    • eslint-config-akrc ^0.0.12
    • happy-dom ^8.1.0
    • husky 8.0.2
    • rollup ^3.7.4
    • rollup-plugin-copy ^3.4.0
    • rollup-plugin-esbuild ^5.0.0
    • rollup-plugin-filesize ^9.1.2
    • taze ^0.8.4
    • typescript 4.9.4
    • vite ^4.0.1
    • vitest 0.26.2
    • vue ^3.2.45
    • vuepress 2.0.0-beta.59

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
A tiny, lightning fast jQuery-like library for modern browsers.

Sprint.js Sprint is a high-performance, 5KB (gzipped) DOM library for modern browsers. Sprint notably shines on bandwidth and resource constrained dev

Benjamin De Cock 4.3k Jan 3, 2023
Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API

Zepto.js – a minimalist JavaScript library Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you u

Thomas Fuchs 15k Dec 31, 2022
jQuery based scrolling Bar, for PC and Smartphones (touch events). It is modern slim, easy to integrate, easy to use. Tested on Firefox/Chrome/Maxthon/iPhone/Android. Very light <7ko min.js and <1Ko min.css.

Nice-Scrollbar Responsive jQuery based scrolling Bar, for PC and Smartphones (touch events). It is modern slim, easy to integrate, easy to use. Tested

Renan LAVAREC 2 Jan 18, 2022
A modern replacement for jQuery.marquee

vanilla-marquee An es5 vanilla-js implementation of jQuery.marquee Installation npm i vanilla-marquee Usage import marquee from 'vanilla-marquee' ne

null 26 Dec 27, 2022
Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.

Sortable Sortable is a JavaScript library for reorderable drag-and-drop lists. Demo: http://sortablejs.github.io/Sortable/ Features Supports touch dev

SortableJS 26.1k Jan 5, 2023
An informal website of the alternative of KdB, an curriculum planning support system used in University of Tsukuba

alternative-tsukuba-kdb An informal website of the alternative of KdB, a curriculum planning support system used in University of Tsukuba. This reposi

いなにわうどん 27 Nov 25, 2022
A alternative to Github Copilot for vscode until you get the access to github copilot

Clara-Copilot ?? Code Howdy ?? I know you guys are ?? waiting for Github Copilot Here is a alternative one for now ?? ⭐ Star is all i want nothing muc

BadBoy17G 245 Jan 8, 2023
GetOsLocalesCrossPlatform - A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers

getOsLocalesCrossPlatform A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers This script is

null 1 Jan 2, 2022
A Fast & Light Virtual DOM Alternative

hyper(HTML) ?? Community Announcement Please ask questions in the dedicated discussions repository, to help the community around this project grow ♥ A

Andrea Giammarchi 3k Dec 30, 2022
A container-friendly alternative to os.cpus().length. Both cgroups v1 and cgroups v2 are supported.

node-cpu-count A container-friendly alternative to os.cpus().length. Both cgroups v1 and cgroups v2 are supported. Installation $ npm install node-cpu

Jiahao Lu 2 Jan 17, 2022
A JSDOM alternative with support for server side rendering of web components

About A JSDOM alternative with support for server side rendering of web components. Happy DOM aim to support the most common functionality of a web br

David Ortner 1.6k Dec 30, 2022
Privacy-focused Google Fonts alternative

Privacy-focused Google Fonts CDN alternative I wrote it in an hour, so please report bugs here. Several improvements could be made here and there, so

coolLabs 245 Dec 27, 2022
(🔗, 🌲) Web3 Link Tree is a free & open-source alternative to Linktree built with React.js, Next.js, Tailwind and Web3-React

Getting Started Read the detailed guide here Customize Add your name, wallet address, social media links and more in config.ts Images Save images to t

Naut 35 Sep 20, 2022
🔧 Alternative to 'eval' in JavaScript that is customizable and safer!

?? better-eval An alternative to eval() in JavaScript that is customizable and safer! The eval function sucks, and there lacks alternatives that provi

Bharadwaj Duggaraju 32 Sep 14, 2022
An extension to Panic's Nova editor currently providing an alternative file browser.

Explorer.novaextension Welcome to the repository of the Explorer Nova extension. The actual extension and its README can be found only one directory a

null 7 Nov 14, 2022
A minimal & self-hostable alternative to pastebin intended for code

minBin A minimal & self-hostable alternative to pastebin intended for code Use ⌨️ A public instance is available at https://bin.kio.dev/ Building ?? n

Kio 4 Dec 29, 2022
An alternative viewer for DevDAO NFT with a ✨holographic✨ twist

Holo DevDAO An alternative viewer for DevDAO NFT with a ✨ holographic ✨ twist. Pre-requisites node version >= 15.0.1 & npm >= 7.20.6. If you have nvm

Naomi Hauret 19 Dec 17, 2022
Free Obisidian Publish alternative, for publishing your digital garden.

What is MindStone? MindStone is a free open-source alternative solution to Obsidian Publish Here how it look like once published, checkout demo versio

Tuan Cao 297 Dec 30, 2022
A Proxy based alternative to json-watch module.

@webreflection/json-watch Social Media Photo by Andrik Langfield on Unsplash A modern take at this 7yo json-watch module. import watcher from '@webref

Andrea Giammarchi 12 Sep 9, 2022