1e41f4b71Sopenharmony_ci# File Organization
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## Directory Structure
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ciThe following figure shows the typical directory structure of the JavaScript module \(**entry/src/main/js/module**\) for an application with feature abilities \(FA\) using JavaScript APIs.
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci**Figure 1** Directory structure
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci![unnaming-(1)](figures/unnaming-(1).png)
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci**Figure 2** Directory structure for resource sharing<sup>5+</sup>  
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci![directory-structure-for-resource-sharing-5+](figures/directory-structure-for-resource-sharing-5+.png)
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ciFunctions of the files are as follows:
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci-   .hml  files describe the page layout.
18e41f4b71Sopenharmony_ci-   .css  files describe the page style.
19e41f4b71Sopenharmony_ci-   .js  files process the page logic and user interactions .
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ciFunctions of the folders are as follows:
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci-   The **app.js** file manages global JavaScript logics and application lifecycle. For details, see [app.js](js-framework-js-file.md).
24e41f4b71Sopenharmony_ci-   The **pages** directory stores all component pages.
25e41f4b71Sopenharmony_ci-   The **common** directory stores public resource files, such as media resources, custom components,  and  .js  files.
26e41f4b71Sopenharmony_ci-   The **resources** directory stores resource configuration files, for example, for multi-resolution loading. For details, see  [Resource Limitations and Access](js-framework-resource-restriction.md).
27e41f4b71Sopenharmony_ci-   The **share** directory<sup>5+</sup>  is used to configure resources shared by multiple instances. For example, images and JSON files in this directory can be shared by **default1** and **default2** instances.
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci>**NOTE** 
30e41f4b71Sopenharmony_ci>
31e41f4b71Sopenharmony_ci>-   The **i18n** and **resources** folders cannot be renamed.
32e41f4b71Sopenharmony_ci>-   If the same resource name and directory are used under the  share  directory and the instance \(**default**\) directory, the resource in the instance directory will be used when you reference the directory.
33e41f4b71Sopenharmony_ci>-   The **share** directory does not support **i18n**.
34e41f4b71Sopenharmony_ci>-   You should create the optional folders \(shown in the directory structure\) as needed after you create the project in DevEco Studio.
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci## File Access Rules
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ciApplication resources can be accessed via an absolute or relative path. In the JS UI framework, an absolute path starts with a slash \(/\), and a relative path starts with  ./  or  ../. The rules are as follows:
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci-   To reference a code file, use a relative path, for example, **../common/utils.js**.
41e41f4b71Sopenharmony_ci-   To reference a resource file, use an absolute path, for example, **/common/xxx.png**.
42e41f4b71Sopenharmony_ci-   Store code files and resource files in the **common** directory and access the files in a required fashion.
43e41f4b71Sopenharmony_ci-   In a  .css  file, use the  url\(\)  function to create a URL, for example, **url\(/common/xxx.png\)**.
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci>**NOTE** 
46e41f4b71Sopenharmony_ci>
47e41f4b71Sopenharmony_ci>When code file A needs to reference code file B:
48e41f4b71Sopenharmony_ci>
49e41f4b71Sopenharmony_ci>-   If code files A and B are in the same directory, you can use either a relative or absolute path in code file B to reference resource files.
50e41f4b71Sopenharmony_ci>-   If code files A and B are in different directories, you must use an absolute path in code file B to reference resource files because the directory of code file B changes during Webpack packaging.
51e41f4b71Sopenharmony_ci>-   Use an absolute path if you want to dynamically change the resource file path through data binding in a  .js  file.
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci## Media File Formats
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ci**Table 1** Supported image formats
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ci| Image Format | File Format |
58e41f4b71Sopenharmony_ci| ------------ | ----------- |
59e41f4b71Sopenharmony_ci| BMP          | .bmp        |
60e41f4b71Sopenharmony_ci| GIF          | .gif        |
61e41f4b71Sopenharmony_ci| JPEG         | .jpg        |
62e41f4b71Sopenharmony_ci| PNG          | .png        |
63e41f4b71Sopenharmony_ci| WebP         | .webp       |
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ci**Table 2** Supported video formats
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ci| Video Format                    | File Format |
68e41f4b71Sopenharmony_ci| ------------------------------- | ----------- |
69e41f4b71Sopenharmony_ci| H.264 AVC Baseline Profile (BP) | .3gp .mp4   |
70e41f4b71Sopenharmony_ci
71