1.0.1 • Published 10 months ago

nv-facutil-jhist v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

nv-facutil-jhist

  • just a Array of json
  • 3 methods: save | back | srch(ptrn: RegExp | JsonValue)
  • for test nvlang console.log. console.log of nvlang using sqlite, the data is all json. it has a in-memory-short-history(just a array)
  • its slow , only suited for repl/cli

install

  • npm install nv-facutil-jhist

splitted

usage

  const x   = require("nv-facutil-jhist");

example

	> var hist = x(20)
	> hist.max_sz_
	20
	> 
	> hist
	Jhist(0) []
	> hist.save([1,2,3,4])
	[ 1, 2, 3, 4 ]
	> 
	> hist
	Jhist(1) [ [ 1, 2, 3, 4 ] ]
	> 
	> 
	> hist.save({a:1,b:[1,2,3,4]})
	{ a: 1, b: [ 1, 2, 3, 4 ] }
	> 
	>
	> hist.save(1)
	1
	> hist.save(2)
	2
	> hist.save(3)
	3
	> 
	> hist
	Jhist(5) [ [ 1, 2, 3, 4 ], { a: 1, b: [ 1, 2, 3, 4 ] }, 1, 2, 3 ]
	> 


	 hist.srch([1,2,3,4])
	 
	>  
	[ 
	  [ [ 1, 2, 3, 4 ],       0 ], 
	  [ { a: 1, b: [Array] }, 1 ] 
	]
	> 

METHODS

	hist.back    hist.save                  hist.srch

            hist.is_full               hist.max_sz_ 

APIS

LICENSE

  • ISC
1.0.1

10 months ago