Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
ang-tangle is a tool that can collect your static JavaScript, HTML, and JSON resources for an AngularJS-based application into a single .js file, and associated sourcemap for debugging.
Install globally via:
sudo npm -g https://github.com/pmuellr/ang-tangle.git
or maybe the package is on npm at this point and you can use:
sudo npm -g install ang-tangle
(note: sudo
not needed for windows)
This will install a global command ang-tangle.
If you just want to use it as a tool within your project, you can of course install locally instead of globally (ie, don't use the -g flag).
You run ang-tangle by passing the name of a directory which contains your angular JavaScript scripts, HTML files, and JSON data files. ang-tangle can also handle CoffeeScript and Markdown files.
From here in, we'll reference this directory as the "input directory".
In your project, you should create a new directory - the input directory - to store these angular resources; and just these angular resources. ang-tangle doesn't handle images, css files, etc. It only handles the following files:
.js
.coffee
.litcoffee
.html
.md
.json
The input directory should have at least one script in it - init.js
(or init.coffee
or init.litcoffee
), which is a script which should
create your angular module.
The rest of your angular scripts can be in the input directory also, or any subdirectory of the input directory.
ang-tangle will also take
.html
and .md
files in any directory,
and make them available via a service named views
.
The views
service is an object whose properties are the names
of the .html
or .md
files relative to the input directory,
and the values are the contents of the files.
ang-tangle will also take
.json
files in any directory,
and make them available via a service named data
.
The data
service is an object whose properties are the names
of the .json
files relative to the input directory,
and values are the JSON.parse()
d objects of those files.
AngTangle
objectYour scripts have access to a object named AngTangle
. The AngTangle
object
has the same methods as the
angular module
object, and is
bound to the module you create in the init
script.
There is one additional method on the AngTangle
object - module()
, which
is used to create the module in init
script. The signature is the same
as the angular.module()
function.
You should create your angular module with:
AngTangle.module(name[, requires], configFn)
just like you do with angular.module()
.
If you call the module()
function with no arguments, it will
return the module you previously created with AngTangle.module(...)
.
Another goodie is that various registration methods of the angular module
object,
like Module::service()
can
be used without the name parameter. The name used when making the actual call
will be the name of the script, without any path or extension. For instance,
if you have file views/hello.js
, whose contents are:
AngTangle.controller(function(...){...})
This will be invoked internally as:
AngTangle.module().controller("hello", function(...){...})
ang-tangle [options] input-directory output-file
input-directory is a directory of files to ang-tangle-ize
output-file is the name of the file to be generated
options:
-v --verbose be verbose
To hack on ang-tangle code itself, you should first install
jbuild
. Then run
npm install
, or course.
Run jbuild
by itself in the project directory to see the tasks available.
https://github.com/pmuellr/ang-tangle
Apache License Version 2.0
FAQs
tangles source files into an angular application
The npm package ang-tangle receives a total of 0 weekly downloads. As such, ang-tangle popularity was classified as not popular.
We found that ang-tangle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.