New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

superjoin

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superjoin

Brings node.js like module loader support to the web

latest
Source
npmnpm
Version
0.6.3
Version published
Weekly downloads
19
90%
Maintainers
4
Weekly downloads
 
Created
Source

Superjoin

Superjoin is a module loader for the web. It brings Node.js like require support to the front-end. It uses npm or bower as package storage and gives you the possibility to use your own local packages.

Installation

Superjoin is available on NPM the packagemanager for Node.js

The command to install it global:

npm install -g superjoin

If you prefer a local installation then remove the -g flag from install command.

Requirements

Node.js >= 4.2.0

Usage of Superjoin:

Superjoin can be configured with a superjoin.json file placed everywhere in your project. A minimum configuration looks like:

{
    "name": "myproject",
    "main": "index.js",
    "files": [
        "hello.js"
    ]
}

Superjoin parse all modules an includes submodules automatically. You mustn't add all your requirements in the superjoin file.

Run the build job

$ superjoin -o build.js

Run this command from the same folder where your superjoin.json file is. That command will create a bundle with all modules and their requirements.

Include the build file

Place this simple html snippet in the head of your index.html

<script type="text/javascript" src="build.js"></script>

Inside your code

//Load local modules
var myModule = require('./modules/myModule.js');

//Load from node_modules or bower_components
var $ = require('jquery');

The difference of local and npm/bower modules is the leading ./ or ../. If a module name starts with ./ or ../ it will be loaded as a local file. All other modules are being processed as npm or bower modules.

The loading order of npm/bower modules is the following:

  • Tries to load it from bower_components. If no bower_module folder is found, tries to load it from a bower_components folder in the parent directory, until the root directory.

  • Tries to load it from node_modules. If no bower_module folder is found, tries to load it from a node_modules folder in the parent directory, until the root directory.

  • Tries to resolve the path as a local module.

  • Throws a module not found error.

Read the full documentation

Superjoin as a plugin

Looking for plugins?

Superjoin plugin for Grunt.

Keywords

require

FAQs

Package last updated on 20 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts