{"id":49453665,"url":"https://github.com/mdarif/JavaScript-Boilerplate","last_synced_at":"2026-06-02T05:00:45.763Z","repository":{"id":3452815,"uuid":"4506367","full_name":"mdarif/JavaScript-Boilerplate","owner":"mdarif","description":"JavaScript Boilerplate is the collection of best practices using a design pattern (global abetment) with the namespaces which would help us out to protect our code in a modular way with some commonly used utility methods, it’s equipped with the configuration file in the form object literal. It would be a template over which people can build their projects. We would also be looking into different APIs that can combine along with the best practices to enhance our customized solution. ","archived":false,"fork":false,"pushed_at":"2020-02-16T16:58:38.000Z","size":781,"stargazers_count":74,"open_issues_count":1,"forks_count":34,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-10-04T15:33:09.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdarif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-31T10:28:05.000Z","updated_at":"2025-01-24T16:01:46.000Z","dependencies_parsed_at":"2022-08-28T05:40:18.152Z","dependency_job_id":null,"html_url":"https://github.com/mdarif/JavaScript-Boilerplate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mdarif/JavaScript-Boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdarif%2FJavaScript-Boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdarif%2FJavaScript-Boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdarif%2FJavaScript-Boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdarif%2FJavaScript-Boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdarif","download_url":"https://codeload.github.com/mdarif/JavaScript-Boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdarif%2FJavaScript-Boilerplate/sbom","scorecard":{"id":632794,"data":{"date":"2025-08-11","repo":{"name":"github.com/mdarif/JavaScript-Boilerplate","commit":"b48bfbcfe2f417fa5ece0b50046bf08dcd673ec0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch '1.1'","Warn: branch protection not enabled for branch '1.0'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T08:21:57.604Z","repository_id":3452815,"created_at":"2025-08-21T08:21:57.605Z","updated_at":"2025-08-21T08:21:57.605Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33806987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-30T04:01:03.703Z","updated_at":"2026-06-02T05:00:45.757Z","avatar_url":"https://github.com/mdarif.png","language":"JavaScript","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"# JavaScript Boilerplate v1.2\n\n[![Build Status][build-image]][build-url]   [![Dependency Status][dependencies-image]][dependencies-url]   [![License][license-image]][license-url]   [![Version][version-image]][version-url] [![Code Climate][codeclimate-image]] [codeclimate-url]\n\nJavaScript Boilerplate is the collection of best practices using a design pattern (Global Abatement) with the use of defined namespaces that would help you to protect our code. It is developed in a modular way with some commonly used utility methods provided that you would find useful for common operations. It is equipped with the configuration file in the form of an object literal that can be used to store global objects, config ids, URLs or textual strings. This framework has been designed to work as a ready to use template that you can build further in your projects as needed as it outlines the framework neatly and exhibits an approach to extend it.\n\n## What's new in v1.2?\n* Have added the Jasmine Test Suite to unit test the boilerplate code with or without PhantomJS, one can fire up the same through Chrome as well\n* Grunt build has been enhanced tremendously\n* JavaScript syntax highlighting has been added\n* `MODULE` has renamed to `JSB` for better JavaScript semantics\n* Travis CI has been kicked off\n* Made several small changes like `use strict`, dir changes, css fixes, additional grunt plug-ins also have been added etc.\n\n## Files in Repository\n\n1. `src/index.html` - An html help file illustrating helper functions.\n\n2. `src/js/_config.js` - Config is having general details that will be commonly used across the application. Parameters like URLs, services, theme to be used within the application.\n\n3. `src/js/_helper.js` - Helper utility functions that are required across different modules or even within a single module.\n\n4. `src/js/_main.js` - It defines the main module. We have used IIFE (Intermediately invoking function expression) namespacing and global abatement in this logic. JSB is main namespace that has been defined and JSB.helper is one of the components.\n\n5. `src/css/style.css` - Style sheets for the html help file.\n\n## Usage\n\n1. Clone the repository using the quick start guide. To get started include the JS files in your js directory.\n\n\tThe starting point is the `src/js/_main.js` file which has defined the main module and the component to be used. If you were to observe the code,\n\n\t\t(function (JSB, $, undefined) {\n\n\t\t\t...... (2)\n\n\t\t})(window.JSB = window.JSB || {}, jQuery);\n\n\tThe above code defines the `JSB` namespace and also passes true values of `jquery` and `undefined` to the inner component. Instead of `JSB` you can define your project name or application name as well and that would become your global namespace under which all the other components should be declared/defined. For e.g. if it is a project name `MYPROJECT` instead of `JSB` you can even write `MYPROJECT` as well.\n\n\tOnce you have defined the wrapper (global namespace), you can start of modules inside the global namespace.\n\n2. The second step would be to define the components, which can be page level or widget level too.\n\n\n\tJSB.subModule = (function () {\n\t\tfunction _subModule() {\n\t\t... (3)\n\t\t}\n\t\treturn new _subModule()\n\t })();\n\n\n   The above code has defined a component called helper as a sub module of `JSB` namespace. `JSB.helper` holds an object that gets returned through `new _subModule()`. We can define all the functions that we want for the helper module inside the function `_subModule()`.\n\n\n3. The third step would be to define the private values, private functions , privileged functions etc. within the `_subModule` function. Comments have been provided as to which one is a private function and which is a privileged one. At the end of the function the `init()` function is exposed which in turn returns the object itself. When the object is returned all the privileged functions are exposed along with it and are accessible outside.\n\n\n\n4. Next is the `src/js/_config.js` file, which has all the global parameters that needs to be leveraged across the application. Think of this file/module as a container file to define your global variables, URLS etc. It is globally available inside the `JSB` namespace and we can access the parameters by specifying `JSB.config.param` to get its value in any other component. Here it has been primarily defined as an object literal as everything needs to be exposed globally.\n\n5. For creating utility methods to be used across application, you can leverage the `src/js/_helper.js` file. It works on the same principle as the `src/js/_main.js`. For E.g. the way to access a helper function outside the module would be `JSB.helper.getCookie` for the `getCookie` function.\n\n\n## Quick start\n\nClone the git repo - `git clone git://github.com/mdarif/JavaScript-Boilerplate.git` - or [download it](https://github.com/mdarif/JavaScript-Boilerplate/zipball/master)\n\nYou can also get the JavaScript Boilerplate through npm if you have already installed node.\n\n\tnpm install javascript-boilerplate\n\n*Make sure, you should have [node](https://nodejs.org/download/) installed on your machine before running `npm` command\n\n## Grunt Build\n\nInstall [Grunt](http://gruntjs.com/getting-started).\n\nOR\n\n###Follow the below instructions to install and setup the `Grunt`\n\nInstall Grunt CLI, this will put the grunt command in your system path, allowing it to be run from any directory.\n\n\t$ npm install -g grunt-cli\n\nNow install Grunt\n\n\t$ npm install grunt\n\nYou should also install all the dependencies\n\n\t$ npm install\n\n###Follow the below instructions to install and setup the `compass task`\n_Run this task with the `grunt compass` command._\n\n[Compass](http://compass-style.org/) is an open-source authoring framework for the [Sass](http://sass-lang.com/) css preprocessor. It helps you build stylesheets faster with a huge library of Sass mixins and functions, advanced tools for spriting, and workflow improvements including file based Sass configuration and a simple pattern for building and using Compass extensions.\n\nThis task requires you to have [Ruby](http://www.ruby-lang.org/en/downloads/), [Sass](http://sass-lang.com/tutorial.html), and [Compass](http://compass-style.org/install/) \u003e=0.12.2 installed. If you're on OS X or Linux you probably already have Ruby installed; test with `ruby -v` in your terminal. When you've confirmed you have Ruby installed, run `gem update --system \u0026\u0026 gem install compass` to install Compass and Sass.\n\n### Fire up the grunt server command and see the preview in browser with live-reload enabled for `app` folder content\n\n\t$ grunt server\n\n### Build the Project\n\n\t$ grunt\n\nYou should be able to see the below message for a successful build and a folder name `dist` has been created with all the expected output, parallel to `src` folder, with all the tasks completed.\n\n\tDone, without errors.\n\n### Testing\n\n\t$ grunt test\n\nWe use jasmine as a unit testing framework to test our boilerplate code, as of now it's been only done for `_.main.js`, you would get all the test done in the next release.\n\n\n## Contributing\n\nAnyone and everyone is welcome to [contribute](#).\n\n\n## Project information\n\n* Source: https://github.com/mdarif/JavaScript-Boilerplate\n\n\n## License\nSee [LICENSE](LICENSE)\n\n\n## Author\n\n* Mohammed Arif [@arif_iq](http://twitter.com/arif_iq), [github](https://github.com/mdarif)\n\n[build-image]:            http://img.shields.io/travis/mdarif/JavaScript-Boilerplate.svg?style=flat\n[build-url]:              http://travis-ci.org/mdarif/JavaScript-Boilerplate\n\n[dependencies-image]:     https://gemnasium.com/mdarif/JavaScript-Boilerplate.svg?style=flat\n[dependencies-url]:       https://gemnasium.com/mdarif/JavaScript-Boilerplate\n\n[license-image]:          http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]:            LICENSE\n\n[version-image]:          http://img.shields.io/github/tag/mdarif/JavaScript-Boilerplate.svg?style=flat\n[version-url]:            https://github.com/mdarif/JavaScript-Boilerplate/tags\n\n[codeclimate-image]:      https://codeclimate.com/repos/558392546956804e780009ea/badges/9cb6feeef61e41a567ad/gpa.svg?style=flat\n[codeclimate-url]:        https://codeclimate.com/repos/558392546956804e780009ea/feed\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdarif%2FJavaScript-Boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdarif%2FJavaScript-Boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdarif%2FJavaScript-Boilerplate/lists"}