Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
sapics committed Aug 21, 2024
1 parent 35d475e commit 3a74988
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 997 deletions.
142 changes: 11 additions & 131 deletions asn-country-mmdb/README.md

Large diffs are not rendered by default.

154 changes: 32 additions & 122 deletions asn-mmdb/README.md

Large diffs are not rendered by default.

153 changes: 36 additions & 117 deletions dbip-geo-whois-asn-country-mmdb/README.md

Large diffs are not rendered by default.

160 changes: 33 additions & 127 deletions geo-asn-country-mmdb/README.md

Large diffs are not rendered by default.

158 changes: 35 additions & 123 deletions geo-whois-asn-country-mmdb/README.md

Large diffs are not rendered by default.

148 changes: 36 additions & 112 deletions geolite2-geo-whois-asn-country-mmdb/README.md

Large diffs are not rendered by default.

142 changes: 11 additions & 131 deletions iptoasn-asn-mmdb/README.md

Large diffs are not rendered by default.

141 changes: 11 additions & 130 deletions iptoasn-country-mmdb/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tools/copy-package-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const path = require('path')
var topDir = path.resolve(__dirname, '..')
fs.readdir(topDir, function(err, dirs){
if(err) return console.error(err);
var text = fs.readFileSync(path.join(topDir, 'README.md'), {encoding: "utf8"});
// var text = fs.readFileSync(path.join(topDir, 'README.md'), {encoding: "utf8"});
for(var dir of dirs){
if(dir.endsWith('-mmdb')){
fs.writeFileSync(path.join(topDir, dir, 'README.md'), text.replace(/^#\s*ip-location-db/, '# ip-location-db/' + dir), {encoding: "utf8"})
// fs.writeFileSync(path.join(topDir, dir, 'README.md'), text.replace(/^#\s*ip-location-db/, '# ip-location-db/' + dir), {encoding: "utf8"})
var json = JSON.parse(fs.readFileSync(path.join(topDir, dir.replace('-mmdb', ''), 'package.json'), {encoding: "utf8"}))
json.name += '-mmdb'
json.keywords.push('mmdb')
Expand Down
1 change: 0 additions & 1 deletion tools/create-readme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { info } = require('console');
const fs = require('fs');
const path = require('path');

Expand Down
33 changes: 33 additions & 0 deletions tools/ip-range.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const fs = require('fs');
const path = require('path');
const readline = require('node:readline');

const projectPath = path.resolve(__dirname, '..');
async function run(){
var dirs = fs.readdirSync(projectPath)
for(var dir of dirs){
var v4 = path.join(projectPath, dir, dir + '-ipv4-num.csv')
var v6 = path.join(projectPath, dir, dir + '-ipv6-num.csv')
if(fs.existsSync(v4)){
await getSize(v4)
await getSize(v6)
}
}
}

async function getSize(numFilePath){
return new Promise((resolve, reject) => {
var size = BigInt(0)
readline.createInterface({input: fs.createReadStream(numFilePath)}).on('line', function(line){
var parts = line.split(',')
var start = BigInt(parts[0])
var end = BigInt(parts[1])
size += end - start + BigInt(1)
}).on('close', function(){
console.log(path.basename(numFilePath).replace('-num.csv', ''), size.toString())
resolve()
})
})
}

run()
2 changes: 1 addition & 1 deletion tools/publish-mmdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ do
done

cd $curdir
CURDATE = `date +%Y%m%d`
CURDATE=`date +%Y%m%d`
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "v${CURDATE} MMDB Update"

0 comments on commit 3a74988

Please sign in to comment.