unjquerify
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

unjQuerify

UnjQuerify is a project that can assist developers in migrating code from jQuery to vanilla DOM APIs.

In:

$("#submit").click(function() {
    $("#output").text("The button was clicked!");
    $(".post").hide();
});

Output:

document.getElementById("submit").addEventListener("click", function () {
    document.getElementById("output").textContent = "The button was clicked!";
    document.getElementsByClassName("post").map((_element) => _element.style.display = "none");
});

Built With

  • babel to build an AST and to transform nodes.

Usage

CLI

  • Ensure that npm is available.
  • Use npm install to install dependencies.
  • Run unjQuerify with the provided example script: npm --silent start sample/simple.js.
  • Verify that the console shows the transformed script.

As dependency

  • Ensure that npm is available.
  • Run npm install unjquerify.
  • Import unjQuerify's plugins using `require('unjquerify/build/src/all-plugins')`` or a similar method.

Contributing

Contributions are always welcome. Please see this project's issue tracker.

Some useful resources are the following:

Before submitting a pull request, please verify that your changes pass linting (run with npm run lint). Please include tests for new features.

Readme

Keywords

none

Package Sidebar

Install

npm i unjquerify

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

68.4 kB

Total Files

99

Last publish

Collaborators

  • devbridie