divmgl / nwire Goto Github PK
View Code? Open in Web Editor NEWSimplified dependency injection in TypeScript
Simplified dependency injection in TypeScript
Imported dependencies should only be loaded when attempting to access them. This should cut down on memory costs with complex applications.
Currently, packages live as a single instance. When a consumer requires an imported package, it is looked for in a container, meaning that all packages operate in a singleton scope.
This may be undesirable but I need input from users of this package to know whether imports should not be singleton.
the thingie wouldn't install on Mac OS X 10.5.21
Currently, configuration files require a base URL and strings pointing to modules on a hard disk in order to work.
module.exports = {
url: __dirname, // Base URL
packages: { // Packages to be injected
'server': './server',
'express': 'express'
}
}
Would it make more sense to simply resolve modules from the working directory? Consider the following code.
module.exports = {
packages: {
'server': require('./server'),
'express': require('express')
}
}
Here we are specifically specifying what we want nwire.js to load, so the dependency on the base URL is gone. Any opinions on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.