The command will walk you through a few simple prompts and creates a ready-to-start local development setup for your new jQuery plugin.
Or, fast track with default settings, just pass your plugin name.
npx create-jquery-plugin jquery-my-plugin
This will create a directory with the your plugin name and with all the tools installed.
- Easy-to-use CLI.
- CSS and SCSS templates.
- Creates ready-to-start local development environment.
- Unit testing with Jasmine and Karma.
To start the development process,
cd to your new plugin directory and run
npm start or
For example, if your new plugin is
jquery-my-plugin, just run
cd jquery-my-plugin npm start
It will open the
example/index.html file with Browserify sync. You can start coding on the directory
src, the example page will hot load as you make changes.
The development environment has pre-configured unit testing with Jasmine and Karma.
The test scripts are under the
You can add new test cases there.
You can also configure the tests online on Travis CI.
To run the unit testing:
The project boilerplate is from https://github.com/techlab/jquery-plugin-boilerplate
jquery-my-plugin ├── examples │ └── index.html ├── node_modules ├── src │ ├── js │ │ └── jquery-plugin-boilerplate.js │ └── scss │ └── jquery-plugin-boilerplate.scss ├── test │ ├── test-template.html │ └── test.js ├── .gitignore ├── .npmignore ├── CONTRIBUTING.md ├── gulpfile.js ├── karma.conf.js ├── LICENSE ├── package.json └── README.md
Details on the parameters and settings on the create-jquery-plugin CLI tool.
Package Name is the only required parameter on the tool. You can provide it when tool prompts for it or you can pass as a first argument. If you pass as an argument, the tool will work as a fast track mode and will not prompt for any other settings. All other settings will be the default settings or the previous setting you have provided.
It is the description of your package and it will be added to the README, package.json, and to the plugin files. You can change it any time after you start the development. Default is "Made with create-jquery-plugin".
It is the version of your package and it will be added to the README, package.json, and to the plugin files. You can change it any time after you start the development. Default is "1.0.0".
It is the author of your package and it will be added to the package.json, and to the plugin files. You can change it any time after you start the development. The tool will try to read it from the git if available otherwise it will be empty as default.
It is the repository URL of your package and it will be added to the package.json, and on plugin files. You can change it any time after you start the development. Default is empty.
It is the license of your package and it will be added to the README, package.json, and on plugin files. You can change it any time after you start the development. Default is "MIT".
It is the package-manager of your choice. You can choose npm or yarn. If you choose yarn, make sure you are installed yarn already. Default is npm.
Grateful to the authors and contributers of create-react-library and create-react-app from which this project is inspired. Thankful to the jquery-plugin-boilerplate for providing the project templates. Also, thanks to the authors and contributors of the amazing Node.js tools used in this project.
create-jquery-plugin is a free and open-source project, and we are trying hard to improve the project as per the feedback from you. Please help us finding bugs or issues on this project, or give us an idea for a feature. Also, you are most welcome to improve the code, please create a pull-request on the project repository on GitHub.