@plugable-io/js 0.0.7 → 0.0.9
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 +24 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -106,6 +106,30 @@ const response = await client.list({
|
|
|
106
106
|
console.log('Files:', response.files);
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
#### Ordering Results
|
|
110
|
+
|
|
111
|
+
You can order files by `created_at`, `name`, or `byte_size`. The default ordering is `created_at` in descending order (newest first).
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// Order by name (ascending)
|
|
115
|
+
const response = await client.list({
|
|
116
|
+
order_by: 'name',
|
|
117
|
+
order_direction: 'asc'
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Order by file size (descending - largest first)
|
|
121
|
+
const response = await client.list({
|
|
122
|
+
order_by: 'byte_size',
|
|
123
|
+
order_direction: 'desc'
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Order by creation date (ascending - oldest first)
|
|
127
|
+
const response = await client.list({
|
|
128
|
+
order_by: 'created_at',
|
|
129
|
+
order_direction: 'asc'
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
109
133
|
### Finding a File
|
|
110
134
|
|
|
111
135
|
You can find a single file using `find`. This is a convenience method that searches for files and returns the first match. It's useful for finding files by metadata or other criteria.
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plugable-io/js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "JavaScript client for Plugable File Management API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,5 +39,6 @@
|
|
|
39
39
|
"@types/spark-md5": "^3.0.4",
|
|
40
40
|
"tsup": "^8.0.0",
|
|
41
41
|
"typescript": "^5.0.0"
|
|
42
|
-
}
|
|
42
|
+
},
|
|
43
|
+
"readme": "README.md"
|
|
43
44
|
}
|