Registry / devops / ngbmin

ngbmin

JSON →
library0.2.2jsnpmunverified

AngularJS pre-minifier that transforms named function expressions ending with '$ng' to array-injection syntax. Current stable version: 0.2.2. No active release cadence (last update 2014). Key differentiator: simple rule-based approach vs heuristic detection in ngmin. Suitable for AngularJS 1.x projects using Browserify. Limited community support; consider modern alternatives like babel-plugin-angularjs-annotate.

npm install ngbmin
INSTALL
IMPORT
SIG · NGBMIN
N
ngbmin
devopsjavascriptv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ngbmin
node node_modules/.bin/ngbmin < input.js > output.js
const ngbmin = require('ngbmin')
CLI tool, not a library. Use command line or browserify transform.
ngbmin transform
browserify -t ngbmin main.js -o main.bundle.js
require('ngbmin').transform()
Use as browserify transform via -t flag.
CommonJS require
import ngbmin from 'ngbmin'
Package is CommonJS but provides no usable exports. CLI only.

Installs ngbmin globally and transforms a minimal AngularJS function ending with '$ng' to array-injection syntax.

# Install globally npm install -g ngbmin # Transform a file echo 'var myFactory = function factoryFn$ng($scope, $http) { return {}; }; angular.module("app").factory("myFactory", myFactory);' > input.js ngbmin < input.js > output.js cat output.js # Expected: var myFactory = ['$scope','$http',function factoryFn$ng($scope,$http){return{};}]; angular.module("app").factory("myFactory",myFactory);
Debug
Known issues
deprecatedngbmin is unmaintained since 2014. Use babel-plugin-angularjs-annotate or ng-annotate for modern AngularJS workflows.
fix
Replace with babel-plugin-angularjs-annotate or ng-annotate-webpack-plugin.
affects: >=0.0.0
gotchaOnly transforms named function expressions ending with '$ng'. Anonymous functions or other naming conventions are ignored.
fix
Ensure all factory/service/controller functions are named with '$ng' suffix.
affects: >=0.0.0
gotchaCLI tool only; no JavaScript API. Cannot be used programmatically in Node scripts.
fix
Use child_process.exec to call CLI if needed, or switch to ng-annotate.
affects: >=0.0.0
Errors
Common errors & fixes
require('ngbmin') returns an empty object
ngbmin is a CLI tool with no module exports.
fix
Use as command-line tool or browserify transform, not as a Node require.
Error: Cannot find module 'ngbmin'
Package not installed locally or globally.
fix
Run 'npm install ngbmin' in your project directory.
Expected array but got function
Function name does not end with '$ng'.
fix
Rename the function to end with '$ng' (e.g., 'myCtrl$ng').
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
packagengbmin
ngbmin — npm install ngbmin · libregistry