mirror of
				https://github.com/gabemart/hipku.git
				synced 2025-10-31 15:11:54 +00:00 
			
		
		
		
	v0.0.2 - package for npm
This commit is contained in:
		
							
								
								
									
										1
									
								
								.npmignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.npmignore
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | dist | ||||||
							
								
								
									
										37
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,6 +1,37 @@ | |||||||
| Hipku | # Hipku | ||||||
| ===== |  | ||||||
|  |  | ||||||
| A tiny javascript library to encode IPv6 and IPv4 addresses as haiku. | A tiny javascript library to encode IPv6 and IPv4 addresses as haiku. | ||||||
|  |  | ||||||
| For documentation and a working demo, check out http://gabrielmartin.net/projects/hipku | For full documentation and a working demo, check out http://gabrielmartin.net/projects/hipku | ||||||
|  |  | ||||||
|  | ## Installation | ||||||
|  |  | ||||||
|  | Install with `npm install hipku` or use a browser-ready file in the `dist` folder. | ||||||
|  |  | ||||||
|  | ## Usage | ||||||
|  |  | ||||||
|  | To encode `127.0.0.1` or `::1` call `Hipku.encode('127.0.0.1')` or `Hipku.encode('::1')`. IPv4 addresses must have octets separated by a `.` period character and IPv6 addresses must have hextets separated by a `:` colon character. | ||||||
|  |  | ||||||
|  | When decoding a hipku, such as: | ||||||
|  |  | ||||||
|  |     The weary red dove | ||||||
|  |     fights in the empty tundra. | ||||||
|  |     Jasmine petals dance. | ||||||
|  |    | ||||||
|  | the lines can be separated either by the newline character `\n` or by a space. Both will produce the same result. | ||||||
|  |  | ||||||
|  |     Hipku.decode('The weary red dove\nfights in the empty tundra.\nJasmine petals dance.'); | ||||||
|  |      | ||||||
|  |     > "254.53.93.114" | ||||||
|  |      | ||||||
|  |     Hipku.decode('The weary red dove fights in the empty tundra. Jasmine petals dance.'); | ||||||
|  |      | ||||||
|  |     > "254.53.93.114" | ||||||
|  |    | ||||||
|  | ### Node.js | ||||||
|  |  | ||||||
|  |     var hipku = require('hipku'); | ||||||
|  |  | ||||||
|  |     hipku.encode(`127.0.0.1`); | ||||||
|  |  | ||||||
|  |     hipku.decode('The weary red dove fights in the empty tundra. Jasmine petals dance.'); | ||||||
|   | |||||||
							
								
								
									
										1800
									
								
								hipku.js → dist/hipku.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1800
									
								
								hipku.js → dist/hipku.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1
									
								
								dist/hipku.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								dist/hipku.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										25
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | { | ||||||
|  |   "name": "hipku", | ||||||
|  |   "version": "0.0.2", | ||||||
|  |   "description": "Encode any IP address as a haiku", | ||||||
|  |   "main": "index.js", | ||||||
|  |   "scripts": { | ||||||
|  |     "test": "echo \"TODO: add tests\"" | ||||||
|  |   }, | ||||||
|  |   "repository": { | ||||||
|  |     "type": "git", | ||||||
|  |     "url": "https://github.com/gabemart/hipku.git" | ||||||
|  |   }, | ||||||
|  |   "keywords": [ | ||||||
|  |     "poetry", | ||||||
|  |     "ipv4", | ||||||
|  |     "ipv6", | ||||||
|  |     "haiku" | ||||||
|  |   ], | ||||||
|  |   "author": "Gabriel Martin", | ||||||
|  |   "license": "MIT", | ||||||
|  |   "bugs": { | ||||||
|  |     "url": "https://github.com/gabemart/hipku/issues" | ||||||
|  |   }, | ||||||
|  |   "homepage": "http://gabrielmartin.net/projects/hipku" | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user