Comparing version 0.1.2 to 0.1.3
@@ -1,22 +0,30 @@ | ||
{ "name" : "format" | ||
, "description" : "printf, sprintf, and vsprintf for JavaScript" | ||
, "version" : "0.1.2" | ||
, "homepage" : "http://samhuri.net/proj/format" | ||
, "author" : "Sami Samhuri <sami@samhuri.net>" | ||
, "repository" : | ||
{ "type" : "git" | ||
, "url" : "https://github.com/samsonjs/format.git" | ||
} | ||
, "bugs" : | ||
{ "mail" : "sami@samhuri.net" | ||
, "web" : "https://github.com/samsonjs/format/issues" | ||
} | ||
, "directories" : { "lib" : "./lib" } | ||
, "main" : "./lib/index" | ||
, "engines" : { "node" : "0.4.x || 0.5.x" } | ||
, "licenses" : | ||
[ { "type" : "MIT" | ||
, "url" : "http://github.com/samsonjs/format/raw/master/LICENSE" | ||
{ | ||
"name": "format", | ||
"description": "printf, sprintf, and vsprintf for JavaScript", | ||
"version": "0.1.3", | ||
"homepage": "http://samhuri.net/proj/format", | ||
"author": "Sami Samhuri <sami@samhuri.net>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/samsonjs/format.git" | ||
}, | ||
"bugs": { | ||
"email": "sami@samhuri.net", | ||
"url": "https://github.com/samsonjs/format/issues" | ||
}, | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"main": "./lib/index", | ||
"engines": { | ||
"node": "0.4.x - 0.6.x" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://github.com/samsonjs/format/raw/master/LICENSE" | ||
} | ||
] | ||
} | ||
], | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
} |
@@ -1,14 +0,13 @@ | ||
var sys = require('sys') | ||
, format = require('./format') | ||
var format = require('./lib') | ||
, printf = format.printf | ||
; | ||
format.extendNativeStrings(); | ||
sys.puts('Testing printf:'); | ||
'hello'.printf(); | ||
sys.puts('(expected "hello")'); | ||
'hello %s'.printf('sami'); | ||
sys.puts('(expected "hello sami")'); | ||
'b: %b\nc: %c\nd: %d\nf: %f\no: %o\ns: %s\nx: %x\nX: %X'.printf(42, 65, 42*42, 42*42*42/1000000000, 255, 'sami', 0xfeedface, 0xc0ffee); | ||
sys.puts('(expected "b: 101010\nc: A\nd: 1764\nf: 0.000074\no: 0377\ns: sami\nx: 0xfeedface\nX: 0xC0FFEE")'); | ||
sys.puts('(passed if the output looks ok)'); | ||
console.log('Testing printf:'); | ||
printf('hello'); | ||
console.log('(expected "hello")'); | ||
printf('hello %s', 'sami'); | ||
console.log('(expected "hello sami")'); | ||
printf('b: %b\nc: %c\nd: %d\nf: %f\no: %o\ns: %s\nx: %x\nX: %X', 42, 65, 42*42, 42*42*42/1000000000, 255, 'sami', 0xfeedface, 0xc0ffee); | ||
console.log('(expected "b: 101010\nc: A\nd: 1764\nf: 0.000074\no: 0377\ns: sami\nx: 0xfeedface\nX: 0xC0FFEE")'); | ||
console.log('(passed if the output looks ok)'); | ||
@@ -19,8 +18,8 @@ function assertEqual(a, b) { | ||
sys.puts('Testing format:'); | ||
assertEqual('hello'.format(), 'hello'); | ||
assertEqual('hello %s'.format('sami'), 'hello sami'); | ||
assertEqual('b: %b\nc: %c\nd: %d\nf: %f\no: %o\ns: %s\nx: %x\nX: %X'.format(42, 65, 42*42, 42*42*42/1000000000, 255, 'sami', 0xfeedface, 0xc0ffee), "b: 101010\nc: A\nd: 1764\nf: 0.000074\no: 0377\ns: sami\nx: 0xfeedface\nX: 0xC0FFEE"); | ||
sys.puts('(pass)'); | ||
console.log('Testing format:'); | ||
assertEqual(format.format('hello'), 'hello'); | ||
assertEqual(format.format('hello %s', 'sami'), 'hello sami'); | ||
assertEqual(format.format('b: %b\nc: %c\nd: %d\nf: %f\no: %o\ns: %s\nx: %x\nX: %X', 42, 65, 42*42, 42*42*42/1000000000, 255, 'sami', 0xfeedface, 0xc0ffee), "b: 101010\nc: A\nd: 1764\nf: 0.000074\no: 0377\ns: sami\nx: 0xfeedface\nX: 0xC0FFEE"); | ||
console.log('(pass)'); | ||
sys.puts('all passed'); | ||
console.log('all passed'); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
6993
1
0
1