Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
This module allows loading of javascript files that made for the browser as modules for node.js;
by Shimon Doodkin
license: MIT
syntax:
Object context = jsinc( String file1, ... , String fileN, Object context, Function callback )
example:
https://github.com/shimondoodkin/googlediff
npm install jsinc
var jsinc=require('jsinc');
var date=jsinc( 'date.js' );
console.log(date); // see what's there
// linq example:
// download linq from http://codeplex.com/jslinq
var jsinc = require('jsinc');
var jslinq = jsinc(__dirname+'/deps/jslinq/scripts/JSLINQ.js').window.JSLINQ; // wanted function
var jsinc = require('jsinc');
var date = jsinc( 'date.js', 'date2.js' );
if the last argument is an object then it is used as context.
// if you need XMLHttpRequest for example, you can add it to the sand box like:
// install xmlhttp like: npm install xmlhttprequest
var date=jsinc( 'date.js',{XMLHttpRequest:require('xmlhttprequest')} );
// you can do even staff like this (if you know what are you doing):
var date=jsinc('date.js',this);
// the above does a "mixin" but may have problem (nodejs bug)
// if this module exports getters,setter, and nonenumeratable
// read multiple files in steps by reusing the context
var jsinc = require('jsinc');
var context = jsinc( 'date.js' );
context = jsinc( 'date2.js',context );
var app={}; jsinc( 'date.js',{XMLHttpRequest:require('xmlhttprequest')}, function (date){ app.date=date; }); // if you add a callback function, the file will be read asynchronously.
FAQs
Include non module javascript file as module
The npm package jsinc receives a total of 0 weekly downloads. As such, jsinc popularity was classified as not popular.
We found that jsinc 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.