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

adaptable-text

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adaptable-text - npm Package Compare versions

Comparing version 0.1.2 to 2.0.1

.babelrc

63

package.json
{
"name": "adaptable-text",
"title": "Adaptable Text",
"version": "0.1.2",
"description": "Adapt font size to fit text in element (WIP)",
"version": "2.0.1",
"description": "Adapt font size to a specified width.",
"main": "lib/adaptable-text.js",
"jsnext:main": "lib/adaptable-text.module.js",
"module": "lib/adaptable-text.module.js",
"license": "MIT",
"repository": "https://github.com/dmnsgn/adaptable-text",
"author": {
"name": "Damien Seguin",
"url": "https://dmnsgn.me"
},
"engines": {
"node": ">=0.10.0"
},
"keywords": [
"responsive",
"text",
"adaptable",
"javascript"
"fontsize"
],
"repository": {
"type": "git",
"url": "https://github.com/dmnsgn/adaptable-text.git"
"scripts": {
"dev": "rollup -c -w -m inline",
"clean": "rm -rf lib",
"build": "rollup -c",
"test": "budo test/index.js --open --live",
"prepublishOnly": "npm run build"
},
"bugs": {
"url": "https://github.com/dmnsgn/adaptable-text/issues"
},
"author": {
"name": "Damien Seguin",
"url": "https://github.com/dmnsgn"
},
"license": "MIT",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-coffee": "^0.12.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-uglify": "^0.8.0",
"grunt-contrib-watch": "^0.6.1"
"babel-core": "^6.25.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-latest": "^6.24.1",
"budo": "^10.0.4",
"prettier": "^1.5.3",
"regenerator-runtime": "^0.10.5",
"rollup": "^0.43.1",
"rollup-plugin-babel": "^3.0.1",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-watch": "^4.3.1",
"uglify-js": "^3.0.23"
},
"scripts": {
"test": "grunt travis --verbose"
"dependencies": {
"clamp": "^1.0.1"
}
}

@@ -1,8 +0,66 @@

Adaptable Text (WIP)
=========================
# adaptable-text
> Adapt font size to fit text in element (WIP)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
## Licence
MIT
> Adapt font size to a specified width.
## Install
```
$ npm install --save adaptable-text
```
## Usage
```js
const textToAdapt = new AdaptableText(document.querySelector(".textToAdapt"), {
step: 0.1,
minFontSize: 10,
width: null
});
textToAdapt.init();
// Adapt
const adapt = () => {
textToAdapt.setWidth();
textToAdapt.adapt();
};
// Listen for a resize event
window.addEventListener("resize", adapt);
// Kick off
requestIdleCallback(() => {
adapt();
});
```
|Key|Description
|:---------|:---------|
|**step**|The step used by the generator to calculate the width of the element|
|**minFontSize**|A minimum font size for the element (max would be the size defined in a stylesheet retrieved by `window.getComputedStyle(this.element)`)|
|**width**|A maximum widht for the container.|
## Scripts
### Dev
```bash
npm run dev
```
### Test
```bash
npm run test
```
### Build
```bash
npm run build
```
## License
MIT © [Damien Seguin](https://github.com/dmnsgn)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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