forked from sheetjs/docs.sheetjs.com
		
	
		
			
	
	
		
			41 lines
		
	
	
		
			917 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
		
		
			
		
	
	
			41 lines
		
	
	
		
			917 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
|  | #!/bin/bash
 | ||
|  | # https://docs.sheetjs.com/docs/demos/data/knex | ||
|  | 
 | ||
|  | cd /tmp | ||
|  | mkdir sheetjs-knexjs | ||
|  | cd sheetjs-knexjs | ||
|  | npm init -y | ||
|  | npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz | ||
|  | 
 | ||
|  | curl -LO https://docs.sheetjs.com/knex/SheetJSKnexTest.js | ||
|  | curl -L -O https://docs.sheetjs.com/pres.numbers | ||
|  | 
 | ||
|  | cp SheetJSKnexTest.js SheetJSKnexTestOrig.js | ||
|  | 
 | ||
|  | # Workaround for KnexJS 0.21.20 | ||
|  | 
 | ||
|  | cat SheetJSKnexTestOrig.js | sed 's/better-sqlite3/sqlite/g' > SheetJSKnexTest.js | ||
|  | 
 | ||
|  | for n in 0.21.20; do | ||
|  |   npm i --save knex@$n sqlite3 | ||
|  |   npm ls | grep knex | ||
|  | 
 | ||
|  |   node SheetJSKnexTest.js | ||
|  |   npx xlsx-cli SheetJSKnex.xlsx | ||
|  |   sqlite3 SheetJSKnex.db 'select * from Test_Table' | ||
|  | done | ||
|  | 
 | ||
|  | # Newer KnexJS versions | ||
|  | 
 | ||
|  | mv SheetJSKnexTestOrig.js SheetJSKnexTest.js | ||
|  | 
 | ||
|  | for n in 2.4 2.5 3.1; do | ||
|  |   npm i --save knex@$n better-sqlite3 | ||
|  |   npm ls | grep knex | ||
|  | 
 | ||
|  | 	node SheetJSKnexTest.js | ||
|  |   npx xlsx-cli SheetJSKnex.xlsx | ||
|  |   sqlite3 SheetJSKnex.db 'select * from Test_Table' | ||
|  | done | ||
|  | 
 |