list-github-dir-content
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -27,5 +27,2 @@ const fetch = require('node-fetch'); // Automatically excluded in browser bundles | ||
const contents = await response.json(); | ||
if (contents.truncated) { | ||
return viaContentsApi(repo, dir, token); | ||
} | ||
for (const item of contents.tree) { | ||
@@ -36,2 +33,3 @@ if (item.type === 'blob' && item.path.startsWith(dir)) { | ||
} | ||
files.truncated = contents.truncated; | ||
return files; | ||
@@ -38,0 +36,0 @@ } |
{ | ||
"name": "list-github-dir-content", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "List all the files in a GitHub repo’s directory", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -25,2 +25,7 @@ # list-github-dir-content [![Build Status](https://travis-ci.org/bfred-it/list-github-dir-content.svg?branch=master)](https://travis-ci.org/bfred-it/list-github-dir-content) | ||
// ['src/file.js', 'src/styles/main.css', ...] | ||
// listContent.viaTreesApi also adds a `truncated` property | ||
if (filesArray.truncated) { | ||
// Perhaps try with viaContentsApi? | ||
} | ||
``` | ||
@@ -40,3 +45,3 @@ | ||
Notice: they're both the same and `viaTreesApi` may **also** try to use `viaContentsApi` if the repo has more files than required. | ||
**Notice:** while they work differently, they have the same output if no limit was reached. | ||
@@ -46,3 +51,3 @@ Known issues: | ||
- `viaContentsApi` is limited to 1000 files _per directory_ | ||
- `viaTreesApi` is limited to an unknown amount of files _per repo_ | ||
- `viaTreesApi` is limited to around 60,000 files _per repo_ | ||
@@ -49,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5672
75
37