alipackage 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/alipackage-1.0.0.tgz +0 -0
- package/app.cjs +9 -0
- package/app.mjs +9 -0
- package/index.cjs +12 -0
- package/index.mjs +10 -0
- package/package.json +13 -0
package/README.md
ADDED
|
File without changes
|
|
Binary file
|
package/app.cjs
ADDED
package/app.mjs
ADDED
package/index.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function mypackage(app) {
|
|
2
|
+
if (!app || !app.get) {
|
|
3
|
+
throw new Error("Express app instance required");
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
app.get("/mypackage", (req, res) => {
|
|
7
|
+
console.log(`${req.method} request for '${req.url}'`);
|
|
8
|
+
res.send("mypackage route accessed.....");
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = mypackage;
|
package/index.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default function mypackage(app) {
|
|
2
|
+
if (!app || !app.get) {
|
|
3
|
+
throw new Error("Express app instance required");
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
app.get("/mypackage", (req, res) => {
|
|
7
|
+
console.log(`${req.method} request for '${req.url}'`);
|
|
8
|
+
res.send("mypackage route accessed.....");
|
|
9
|
+
});
|
|
10
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alipackage",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "My first npm package",
|
|
5
|
+
"main": "index.cjs",
|
|
6
|
+
"exports": {
|
|
7
|
+
"require": "./index.cjs",
|
|
8
|
+
"import": "./index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["express", "middleware"],
|
|
11
|
+
"author": "Muddassir Ali",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|