mbkbucket 1.1.0 → 1.1.1

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 CHANGED
@@ -3,10 +3,50 @@
3
3
  [![Version](https://img.shields.io/npm/v/mbkbucket.svg)](https://www.npmjs.com/package/mbkbucket)
4
4
  [![License](https://img.shields.io/badge/License-GPL--2.0-blue.svg)](LICENSE)
5
5
  [![Node.js](https://img.shields.io/badge/node-%3E%3D14.0.0-brightgreen.svg)](https://nodejs.org/)
6
- [![Publish](https://github.com/MIbnEKhalid/mbkbucket/actions/workflows/publish.yml/badge.svg?branch=main)](https://github.com/MIbnEKhalid/mbkbucket/actions/workflows/publish.yml)
6
+ [![Publish to npm and GitHub Packages](https://github.com/MIbnEKhalid/mbkbucket/actions/workflows/publish.yml/badge.svg)](https://github.com/MIbnEKhalid/mbkbucket/actions/workflows/publish.yml)
7
+
8
+ ## Usage ✅
9
+
10
+ Install:
11
+
12
+ ```bash
13
+ npm install mbkbucket
14
+ ```
15
+
16
+ ### Quick examples
17
+
18
+ - Named imports from package root:
19
+
20
+ ```js
21
+ import { uploadFile, downloadFile, listfiles, getBucketConfig, packageJson, bucket } from 'mbkbucket';
22
+ ```
23
+
24
+ - Default aggregate import:
25
+
26
+ ```js
27
+ import mbkbucket from 'mbkbucket';
28
+ // mbkbucket.uploadFile(...)
29
+ ```
30
+
31
+ - Direct subpath imports (optional):
32
+
33
+ ```js
34
+ import { uploadFile } from 'mbkbucket/lib/s3';
35
+ import { packageJson } from 'mbkbucket/lib/config/index';
36
+ import bucketRouter from 'mbkbucket/lib/bucket';
37
+ ```
38
+
39
+ ### Notes
40
+
41
+ - All functions, objects, and variables exported from `lib/` are re-exported at the package root for convenience.
42
+ - The package includes TypeScript declarations (`index.d.ts`) so IDEs and TypeScript projects get proper typings.
43
+ - The default export of the package is the configured Express `server` instance; the `bucket` router is available as `bucket` (named export).
44
+
45
+ ---
46
+
7
47
 
8
48
  ## Contact
9
49
 
10
50
  For questions or contributions, please contact Muhammad Bin Khalid at [mbktechstudio.com/Support](https://mbktechstudio.com/Support/?Project=MIbnEKhalidWeb), [support@mbktechstudio.com](mailto:support@mbktechstudio.com) or [chmuhammadbinkhalid28@gmail.com](mailto:chmuhammadbinkhalid28@gmail.com).
11
51
 
12
- Developed by [Muhammad Bin Khalid](https://github.com/MIbnEKhalid) at [MBK Tech Studio](https://mbktech.org/).
52
+ Developed by [Muhammad Bin Khalid](https://github.com/MIbnEKhalid) at [MBK Tech Studio](https://mbktech.org/).
package/index.js CHANGED
@@ -138,7 +138,7 @@ server.use(mbkauthe);
138
138
  server.use(generalLimiter);
139
139
  server.use(bucket);
140
140
 
141
- if (process.env.test === "dev") {
141
+ if (process.env.mbkbucket_testl === "dev") {
142
142
 
143
143
  console.log("[mbkbucket] Dev mode is enabled. Starting server in dev mode.");
144
144
 
@@ -195,4 +195,5 @@ if (process.env.test === "dev") {
195
195
  await checkVersion();
196
196
 
197
197
 
198
+ export * from "./lib/index.js";
198
199
  export default server;
package/lib/index.js ADDED
@@ -0,0 +1,17 @@
1
+ // Barrel file: re-export all public items from lib
2
+ export * from './s3.js';
3
+ export * from './config/index.js';
4
+ export { default as bucket } from './bucket.js';
5
+
6
+ import * as s3 from './s3.js';
7
+ import * as config from './config/index.js';
8
+ import bucket from './bucket.js';
9
+
10
+ // Default aggregate export for convenience
11
+ const defaultExport = {
12
+ ...s3,
13
+ ...config,
14
+ bucket,
15
+ };
16
+
17
+ export default defaultExport;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mbkbucket",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "S3 Bucket manager for mbktech.org apps",
5
5
  "author": "Muhammad Bin Khalid",
6
6
  "homepage": "https://github.com/MIbnEKhalid/mbkbucket#readme",
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "types": "index.d.ts",
11
11
  "scripts": {
12
- "dev": "cross-env test=dev nodemon index.js",
12
+ "dev": "cross-env mbkbucket_test=dev nodemon index.js",
13
13
  "test": "echo \\\"Error: no test specified\\\" && exit 1"
14
14
  },
15
15
  "dependencies": {