Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-time

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-time

A tiny library that converts milliseconds to and from CSS time.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
336
decreased by-42.07%
Maintainers
1
Weekly downloads
 
Created
Source

css-time.js

Build status

A tiny JavaScript library that converts milliseconds to and from CSS time.

Installation

Via NPM

npm install css-time

Via Jam

jam install css-time

Via Git

git clone git@github.com:philbooth/css-time.js.git

Usage

Loading the library

Via CommonJS
var cssTime = require('css-time');
Via AMD
require('css-time', function (cssTime) {
});
Globally
<script src="css-time.min.js"></script>

Calling the exported functions

Two functions are exported, from and to.

function from (string)

Returns the number of milliseconds represented by the CSS time string passed in the argument.

Examples
cssTime.from('500ms'); // returns 500

cssTime.from('-1.5s'); // returns -1500
function to (number)

Returns a CSS time string representing the number of milliseconds passed in the argument.

Examples
cssTime.to(500); // returns '500ms'

cssTime.to(-0.5); // returns '-0.5ms'

Development

Dependencies

The build environment relies on Node.js, NPM, Jake, JSHint, Mocha, Chai and UglifyJS. Assuming that you already have Node.js and NPM set up, you just need to run npm install to install all of the dependencies as listed in package.json.

Unit tests

The unit tests are in test/css-time.js. You can run them with the command npm test or jake test.

Keywords

FAQs

Package last updated on 23 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc